Add /Zc:__cplusplus to MSVC compiler flags

Fix build errors for a clean build on Windows. For details about the
CMake teting code see https://stackoverflow.com/a/60890947/1254880
This commit is contained in:
Tarcisio Rodrigues 2021-01-28 23:58:41 -03:00
parent 6327cf12c2
commit eb5613563b
1 changed files with 4 additions and 0 deletions

View File

@ -185,6 +185,10 @@ if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU|Intel" AND NOT CMAKE_SYSTEM
endif()
endif()
if (MSVC AND MSVC_VERSION GREATER_EQUAL 1914)
list(APPEND mi_cflags /Zc:__cplusplus)
endif()
# Architecture flags
if(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "arm" AND NOT APPLE)
check_cxx_compiler_flag(-march=native CXX_SUPPORTS_MARCH_NATIVE)