msvc: enable compiler checks added in vs 17.5

This commit is contained in:
Shawn Hoffman 2023-02-22 13:22:08 -08:00
parent 35bde3e7c8
commit 5bf9ad7d82
2 changed files with 3 additions and 5 deletions

View File

@ -326,7 +326,7 @@ if(MSVC)
# Note: In msbuild build, this gets set by msbuild by default
add_compile_options(/Zc:inline)
# Fix various other non-conformant behaviors
add_compile_options(/Zc:__cplusplus,enumTypes,externConstexpr,preprocessor,throwingNew)
add_compile_options(/Zc:__cplusplus,enumTypes,externConstexpr,preprocessor,templateScope,throwingNew)
# Enforce strict volatile semantics as per ISO C++
add_compile_options(/volatile:iso)

View File

@ -33,8 +33,7 @@
<!--Enable Standard Conformance-->
<ConformanceMode>true</ConformanceMode>
<!--Enforce some behaviors as standards-conformant when they don't default as such.-->
<!--TODO on VS 17.5: templateScope-->
<AdditionalOptions>/Zc:__cplusplus,enumTypes,externConstexpr,preprocessor,throwingNew /volatile:iso %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>/Zc:__cplusplus,enumTypes,externConstexpr,preprocessor,templateScope,throwingNew /volatile:iso %(AdditionalOptions)</AdditionalOptions>
<!--Enable detailed debug info-->
<AdditionalOptions>/Zo %(AdditionalOptions)</AdditionalOptions>
<!--Treat sources as utf-8-->
@ -74,8 +73,7 @@
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<!--TODO on VS 17.5: /Zc:checkGwOdr-->
<AdditionalOptions>/Gw %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>/Gw /Zc:checkGwOdr %(AdditionalOptions)</AdditionalOptions>
<WholeProgramOptimization Condition="'$(DolphinRelease)'=='true'">true</WholeProgramOptimization>
</ClCompile>
<!--Link Base-->