From 8f4efe57a29609a42322eeb7081414b9156b2306 Mon Sep 17 00:00:00 2001 From: gabime Date: Fri, 12 Mar 2021 15:09:35 +0200 Subject: [PATCH] make sure __cplusplus is defined under msvc --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e694dfc4..45813bac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,11 @@ if(NOT CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD_REQUIRED ON) endif() +# make sure __cplusplus is defined under msvc +if(MSVC) + string(APPEND CMAKE_CXX_FLAGS " /Zc:__cplusplus") +endif() + set(CMAKE_CXX_EXTENSIONS OFF) if(CMAKE_SYSTEM_NAME MATCHES "CYGWIN" OR CMAKE_SYSTEM_NAME MATCHES "MSYS")