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

Otherwise, macros like KI_FALLTHROUGH are not defined properly.

(cherry picked from commit fa6dc95553)
This commit is contained in:
Alex Shvartzkop 2024-03-03 23:28:52 +03:00
parent e196f71d58
commit 4072bc05af
1 changed files with 2 additions and 0 deletions

View File

@ -514,6 +514,8 @@ if( MSVC )
string( APPEND CMAKE_CXX_FLAGS " /wd4800" )
# /Zi: create PDB
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
string( APPEND CMAKE_CXX_FLAGS_RELEASE " /GF" )
string( APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " /GF" )