Define __cplusplus according to C++ standard version on MSVC.

Otherwise, macros like KI_FALLTHROUGH are not defined properly.
This commit is contained in:
Alex Shvartzkop 2024-03-03 23:28:52 +03:00
parent 16953edf6d
commit fa6dc95553
1 changed files with 2 additions and 0 deletions

View File

@ -514,6 +514,8 @@ if( MSVC )
string( APPEND CMAKE_CXX_FLAGS " /wd4800" ) string( APPEND CMAKE_CXX_FLAGS " /wd4800" )
# /Zi: create PDB # /Zi: create PDB
string( APPEND CMAKE_CXX_FLAGS " /Zi" ) string( APPEND CMAKE_CXX_FLAGS " /Zi" )
# /Zc:__cplusplus: define this macro according to C++ standard version
string( APPEND CMAKE_CXX_FLAGS " /Zc:__cplusplus" )
# /GF: enable string pooling # /GF: enable string pooling
string( APPEND CMAKE_CXX_FLAGS_RELEASE " /GF" ) string( APPEND CMAKE_CXX_FLAGS_RELEASE " /GF" )
string( APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " /GF" ) string( APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " /GF" )