From fa6dc95553040b78b93f52cecc01ed31144f88f5 Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Sun, 3 Mar 2024 23:28:52 +0300 Subject: [PATCH] Define __cplusplus according to C++ standard version on MSVC. Otherwise, macros like KI_FALLTHROUGH are not defined properly. --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 69e8ad996e..9be7e27058 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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" )