diff options
author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> | 2020-06-04 20:44:57 +0200 |
---|---|---|
committer | Charles Pigott <charlespigott@googlemail.com> | 2020-06-30 09:43:00 +0100 |
commit | 241e3adae8d387618fb52a75273feed9830de64a (patch) | |
tree | 5a663b2ff4e9ed0f886637da454b5085b2c5c366 /cmake | |
parent | 0d46e20bd4ab4e66e5801b731e0d2b4cb9014ad2 (diff) | |
download | openttd-241e3adae8d387618fb52a75273feed9830de64a.tar.xz |
Fix: use proper flags for suppressing warnings in Clang
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/CompileFlags.cmake | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/cmake/CompileFlags.cmake b/cmake/CompileFlags.cmake index d200b3f50..6fe185df8 100644 --- a/cmake/CompileFlags.cmake +++ b/cmake/CompileFlags.cmake @@ -73,14 +73,21 @@ macro(compile_flags) -fno-strict-aliasing ) - add_compile_options( - # When we are a stable release (Release build + USE_ASSERTS not set), - # assertations are off, which trigger a lot of warnings. We disable - # these warnings for these releases. - "$<${IS_STABLE_RELEASE}:-Wno-unused-variable>" - "$<${IS_STABLE_RELEASE}:-Wno-unused-but-set-parameter>" - "$<${IS_STABLE_RELEASE}:-Wno-unused-but-set-variable>" - ) + # When we are a stable release (Release build + USE_ASSERTS not set), + # assertations are off, which trigger a lot of warnings. We disable + # these warnings for these releases. + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + add_compile_options( + "$<${IS_STABLE_RELEASE}:-Wno-unused-variable>" + "$<${IS_STABLE_RELEASE}:-Wno-unused-but-set-parameter>" + "$<${IS_STABLE_RELEASE}:-Wno-unused-but-set-variable>" + ) + else (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + add_compile_options( + "$<${IS_STABLE_RELEASE}:-Wno-unused-variable>" + "$<${IS_STABLE_RELEASE}:-Wno-unused-parameter>" + ) + endif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # Ninja processes the output so the output from the compiler # isn't directly to a terminal; hence, the default is |