CrucibleEnableCompilerWarnings.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
include_guard(GLOBAL) function(crucible_enable_compiler_warnings TARGET_NAME) get_target_property(TARGET_TYPE "${TARGET_NAME}" TYPE) if(TARGET_TYPE STREQUAL INTERFACE_LIBRARY) return() endif() target_compile_options("${TARGET_NAME}" PRIVATE $<$<CXX_COMPILER_ID:AppleClang>:-Wall -Wextra -Werror> $<$<CXX_COMPILER_ID:Clang>:-Wall -Wextra -Werror> $<$<CXX_COMPILER_ID:GNU>:-Wall -Wextra -Werror> $<$<CXX_COMPILER_ID:MSVC>:/W4 /WX> # msvc: disable warning c4180 (ignored const qualifier) because we const _everything_ $<$<CXX_COMPILER_ID:MSVC>:/wd4180>) endfunction()