Commit Graph

2 Commits

Author SHA1 Message Date
Fabrice de Gans 95337da558 [build] Add basic clang-cl support
XAudio2 is disabled because the included header needs to be updated to
be parseable by clang.
2022-10-15 22:25:34 +00:00
Rafael Kitover 7d454e054a
Fix MSVC compiler/linker flags.
Turn off ccache for vcpkg builds (this is only relevant to MSVC, where
ccache does not work yet.)

Throw an error if CMAKE_BUILD_TYPE is not valid or does not match case
exactly (to make comparisons simple.)

Add SetCompilerLinkerFlags.cmake lib with the functions:

add_compiler_flags()

For each flag passed in, add it to CMAKE_CXX_FLAGS and CMAKE_C_FLAGS if
not already present. Also clears all build-specific flag variables on
every call, if using this functions you must set build-specific flags
yourself.

add_linker_flags()

For each flag passed in, add it to
CMAKE_(EXE|SHARED|MODULE|STATIC)_LINKER_FLAGS if not already present.

Add remove_dupes() function to VbamFunctions.cmake from:

https://stackoverflow.com/a/41416298/262458

This is used to remove duplicate flags in SetCompilerLinkerFlags.cmake
described above.

Use the new functions to set compiler and linker flags for MSVC.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-02-02 22:27:39 +00:00