Fix compiler detection for warning whitelisting

This commit is contained in:
Dale Glass 2022-06-08 16:39:32 +02:00
parent 39706f1c9a
commit df91ada377

View file

@ -151,6 +151,8 @@ if(NOT DEFINED OVERTE_WARNINGS_AS_ERRORS)
endif()
if(OVERTE_WARNINGS_WHITELIST)
include(CMakeDetermineCXXCompiler)
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
message("GCC compiler detected, suppressing some unsolvable warnings.")
add_compile_definitions(OVERTE_WARNINGS_WHITELIST_GCC)
@ -158,7 +160,7 @@ if(OVERTE_WARNINGS_WHITELIST)
message("Clang compiler detected, suppressing some unsolvable warnings.")
add_compile_definitions(OVERTE_WARNINGS_WHITELIST_CLANG)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
message("Clang compiler detected, suppressing some unsolvable warnings.")
message("Microsoft Visual Studio compiler detected, suppressing some unsolvable warnings.")
add_compile_definitions(OVERTE_WARNINGS_WHITELIST_MSVC)
else()
message("We don't know yet how to whitelist warnings for ${CMAKE_CXX_COMPILER_ID}")