From 896ab5478cd943c51fe14ff8e4a1abf7b4102bca Mon Sep 17 00:00:00 2001 From: e-erdal Date: Fri, 24 Jun 2022 11:42:25 +0300 Subject: [PATCH] Add `__cplusplus` for MSVC --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ab5534..98a0a5a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,10 @@ if( APPLE AND NOT XCODE ) set( CMAKE_CXX_FLAGS "-ObjC++" ) endif() +if (MSVC AND (MSVC_VERSION GREATER_EQUAL 1914)) + add_compile_options("/Zc:__cplusplus") +endif() + option( BGFX_BUILD_TOOLS "Build bgfx tools." ON ) option( BGFX_BUILD_EXAMPLES "Build bgfx examples." ON ) option( BGFX_INSTALL "Create installation target." ON )