Enable guard:ehcont compiler flag for MSVC 64 bit architectures

This commit is contained in:
Chuck Walbourn 2022-07-25 18:10:05 -07:00
parent 2eecee4b4d
commit 946d0c9b5c
5 changed files with 15 additions and 0 deletions

View File

@ -226,6 +226,13 @@ if(MSVC)
target_link_options(${t} PRIVATE /SAFESEH) target_link_options(${t} PRIVATE /SAFESEH)
endforeach() endforeach()
endif() endif()
if((MSVC_VERSION GREATER_EQUAL 1928) AND (CMAKE_SIZEOF_VOID_P EQUAL 8))
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_compile_options(${t} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
target_link_options(${t} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
endforeach()
endif()
endif() endif()
if(NOT ${DIRECTX_ARCH} MATCHES "^arm") if(NOT ${DIRECTX_ARCH} MATCHES "^arm")

View File

@ -291,6 +291,7 @@
<AdditionalOptions>/Zc:__cplusplus /Zc:twoPhase- /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus /Zc:twoPhase- /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
<OpenMPSupport>true</OpenMPSupport> <OpenMPSupport>true</OpenMPSupport>
<ExternalWarningLevel>Level4</ExternalWarningLevel> <ExternalWarningLevel>Level4</ExternalWarningLevel>
<GuardEHContMetadata>true</GuardEHContMetadata>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
@ -314,6 +315,7 @@
<AdditionalOptions>/Zc:__cplusplus /Zc:twoPhase- /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus /Zc:twoPhase- /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
<OpenMPSupport>true</OpenMPSupport> <OpenMPSupport>true</OpenMPSupport>
<ExternalWarningLevel>Level4</ExternalWarningLevel> <ExternalWarningLevel>Level4</ExternalWarningLevel>
<GuardEHContMetadata>true</GuardEHContMetadata>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>

View File

@ -291,6 +291,7 @@
<AdditionalOptions>/Zc:__cplusplus /Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus /Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions>
<OpenMPSupport>true</OpenMPSupport> <OpenMPSupport>true</OpenMPSupport>
<ExternalWarningLevel>Level4</ExternalWarningLevel> <ExternalWarningLevel>Level4</ExternalWarningLevel>
<GuardEHContMetadata>true</GuardEHContMetadata>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
@ -314,6 +315,7 @@
<AdditionalOptions>/Zc:__cplusplus /Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus /Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions>
<OpenMPSupport>true</OpenMPSupport> <OpenMPSupport>true</OpenMPSupport>
<ExternalWarningLevel>Level4</ExternalWarningLevel> <ExternalWarningLevel>Level4</ExternalWarningLevel>
<GuardEHContMetadata>true</GuardEHContMetadata>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>

View File

@ -359,6 +359,7 @@
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
<ExternalWarningLevel>Level4</ExternalWarningLevel> <ExternalWarningLevel>Level4</ExternalWarningLevel>
<GuardEHContMetadata>true</GuardEHContMetadata>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
@ -403,6 +404,7 @@
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
<ExternalWarningLevel>Level4</ExternalWarningLevel> <ExternalWarningLevel>Level4</ExternalWarningLevel>
<GuardEHContMetadata>true</GuardEHContMetadata>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>

View File

@ -359,6 +359,7 @@
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<ExternalWarningLevel>Level4</ExternalWarningLevel> <ExternalWarningLevel>Level4</ExternalWarningLevel>
<GuardEHContMetadata>true</GuardEHContMetadata>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
@ -403,6 +404,7 @@
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<ExternalWarningLevel>Level4</ExternalWarningLevel> <ExternalWarningLevel>Level4</ExternalWarningLevel>
<GuardEHContMetadata>true</GuardEHContMetadata>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>