Don't call CMakeDetermineCXXCompiler on Win32, work around lack of CMAKE_CXX_COMPILER_ID being set

This commit is contained in:
Dale Glass 2022-06-09 00:40:28 +02:00
parent 1650b431e0
commit 27fbc4ec16

View file

@ -151,8 +151,10 @@ if(NOT DEFINED OVERTE_WARNINGS_AS_ERRORS)
endif()
if(OVERTE_WARNINGS_WHITELIST)
set(CMAKE_PLATFORM_INFO_DIR "${CMAKE_CURRENT_BINARY_DIR}")
include(CMakeDetermineCXXCompiler)
if (NOT WIN32)
set(CMAKE_PLATFORM_INFO_DIR "${CMAKE_CURRENT_BINARY_DIR}")
include(CMakeDetermineCXXCompiler)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
message("GCC compiler detected, suppressing some unsolvable warnings.")
@ -160,7 +162,7 @@ if(OVERTE_WARNINGS_WHITELIST)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
message("Clang compiler detected, suppressing some unsolvable warnings.")
add_compile_definitions(OVERTE_WARNINGS_WHITELIST_CLANG)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC" OR (CMAKE_CXX_COMPILER_ID MATCHES "" AND WIN32))
message("Microsoft Visual Studio compiler detected, suppressing some unsolvable warnings.")
add_compile_definitions(OVERTE_WARNINGS_WHITELIST_MSVC)
else()