CMake updated to use /Zc:inline and /Zc:lambda (#296)

This commit is contained in:
Chuck Walbourn 2022-12-15 10:29:32 -08:00 committed by GitHub
parent 9fd4d9f6b6
commit 9dd139f44a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -347,7 +347,7 @@ elseif(MINGW)
endforeach() endforeach()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME}) 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() endforeach()
if(ENABLE_CODE_ANALYSIS) if(ENABLE_CODE_ANALYSIS)
@ -374,6 +374,12 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
endforeach() endforeach()
endif() 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) if(BC_USE_OPENMP)
target_compile_options(${PROJECT_NAME} PRIVATE /openmp /Zc:twoPhase-) target_compile_options(${PROJECT_NAME} PRIVATE /openmp /Zc:twoPhase-)
if(BUILD_TOOLS AND WIN32 AND (NOT WINDOWS_STORE)) if(BUILD_TOOLS AND WIN32 AND (NOT WINDOWS_STORE))