Correctly set __cplusplus with /Zc:__cplusplus

pull/930/head
Levin Li 2021-03-12 13:33:02 +08:00
parent a32e905556
commit 4959ffbe6e
1 changed files with 5 additions and 0 deletions

View File

@ -112,6 +112,11 @@ if(MSVC)
# Promoted to errors
# C4316: object allocated on the heap may not be aligned 16
add_compile_options("/wd4244" "/wd4267" "/wd4503" "/wd4800" "/wd4455" "/wd5030" "/bigobj" "/we4316")
if(MSVC_VERSION GREATER_EQUAL 1914)
# /Zc:__cplusplus: correctly set __cplusplus macro value
add_compile_options("/Zc:__cplusplus")
endif()
endif()
if(NOT WIN32)