@@ -9,7 +9,7 @@ if (MSVC)
99 # > extremely noisy and low-value warnings. In general, the STL does not attempt to be `/Wall` clean.
1010 string (REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} " ) # add_compile_options(/W4)
1111
12- elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
12+ elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang " )
1313 # https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
1414 #add_compile_options(-Werror) # Make all warnings into errors
1515 add_compile_options (-Wall -Wextra -Wpedantic -pedantic-errors -Wunused )
@@ -19,8 +19,6 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
1919 add_compile_options (-Wsuggest-override )
2020 add_compile_options (-Woverloaded-virtual )
2121 #add_compile_options(-Warray-bounds)
22- add_compile_options (-Wduplicated-branches -Wduplicated-cond )
23- add_compile_options (-Wtrampolines )
2422 add_compile_options (-Wshadow )
2523 #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wold-style-cast")
2624 #add_compile_options(-Wfloat-equal)
@@ -30,7 +28,12 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
3028 add_compile_options (-Wno-double-promotion ) # implicit conversion of `float` to `double` is fine
3129
3230 add_compile_options (-Wno-array-bounds ) # TODO: fix the code!
33- add_compile_options (-Wno-maybe-uninitialized ) # TODO: fix the code!
31+
32+ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
33+ add_compile_options (-Wduplicated-branches -Wduplicated-cond )
34+ add_compile_options (-Wtrampolines )
35+ add_compile_options (-Wno-maybe-uninitialized ) # TODO: fix the code!
36+ endif ()
3437
3538 # Need a newer compiler than GCC 9
3639 #add_compile_options(-Wnrvo)
0 commit comments