From 9dd139f44a3a0cae9ba0c6d4b90204059504d268 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Thu, 15 Dec 2022 10:29:32 -0800 Subject: [PATCH] CMake updated to use /Zc:inline and /Zc:lambda (#296) --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 423a7ad..b8e336f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -347,7 +347,7 @@ elseif(MINGW) endforeach() elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME}) - target_compile_options(${t} PRIVATE /sdl /permissive- /JMC- /Zc:__cplusplus) + target_compile_options(${t} PRIVATE /sdl /permissive- /JMC- /Zc:__cplusplus /Zc:inline) endforeach() if(ENABLE_CODE_ANALYSIS) @@ -374,6 +374,12 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") endforeach() endif() + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28) + foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME}) + target_compile_options(${t} PRIVATE /Zc:lambda) + endforeach() + endif() + if(BC_USE_OPENMP) target_compile_options(${PROJECT_NAME} PRIVATE /openmp /Zc:twoPhase-) if(BUILD_TOOLS AND WIN32 AND (NOT WINDOWS_STORE))