From d9e3902add8ced38fd548354a91d442bbdfc626a Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Wed, 10 Jan 2024 14:46:41 +0100 Subject: [PATCH] Add /Zc:__cplusplus to define __cplusplus with c++ version number --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 25901f7e..4a17224a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -309,6 +309,16 @@ if (ISLE_BUILD_APP) set_property(TARGET isle PROPERTY SUFFIX ".EXE") endif() +if (MSVC) + # Visual Studio 2017 version 15.7 needs "/Zc:__cplusplus" for __cplusplus + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "19.14.26428") + target_compile_options(lego1 PRIVATE "-Zc:__cplusplus") + if (ISLE_BUILD_APP) + target_compile_options(isle PRIVATE "-Zc:__cplusplus") + endif() + endif() +endif() + if (MSVC_FOR_DECOMP OR MINGW) target_compile_definitions(lego1 PRIVATE "ENABLE_DECOMP_ASSERTS") if (ISLE_BUILD_APP)