From cc193564bb047cac5adcfc12a38bfd2c66043e10 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Mon, 25 Jul 2022 15:21:46 -0700 Subject: [PATCH] Enable guard:ehcont compiler flag for MSVC 64 bit architectures --- CMakeLists.txt | 7 +++++++ DirectXMesh/DirectXMesh_Desktop_2019.vcxproj | 2 ++ DirectXMesh/DirectXMesh_Desktop_2019_Win10.vcxproj | 4 ++++ DirectXMesh/DirectXMesh_Desktop_2022.vcxproj | 2 ++ DirectXMesh/DirectXMesh_Desktop_2022_Win10.vcxproj | 4 ++++ DirectXMesh/DirectXMesh_GDK_2019.vcxproj | 2 ++ DirectXMesh/DirectXMesh_GDK_2022.vcxproj | 2 ++ DirectXMesh/DirectXMesh_Windows10_2019.vcxproj | 2 ++ DirectXMesh/DirectXMesh_Windows10_2022.vcxproj | 2 ++ 9 files changed, 27 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d3b398..ce40c3c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -190,6 +190,13 @@ if(MSVC) target_link_options(${t} PRIVATE /SAFESEH) endforeach() 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 "$<$>:/guard:ehcont>") + target_link_options(${t} PRIVATE "$<$>:/guard:ehcont>") + endforeach() + endif() endif() if(NOT ${DIRECTX_ARCH} MATCHES "^arm") diff --git a/DirectXMesh/DirectXMesh_Desktop_2019.vcxproj b/DirectXMesh/DirectXMesh_Desktop_2019.vcxproj index a1cc39c..dfbe37f 100644 --- a/DirectXMesh/DirectXMesh_Desktop_2019.vcxproj +++ b/DirectXMesh/DirectXMesh_Desktop_2019.vcxproj @@ -213,6 +213,7 @@ $(IntDir)$(TargetName).pdb /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) Level4 + true true @@ -262,6 +263,7 @@ $(IntDir)$(TargetName).pdb /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) Level4 + true true diff --git a/DirectXMesh/DirectXMesh_Desktop_2019_Win10.vcxproj b/DirectXMesh/DirectXMesh_Desktop_2019_Win10.vcxproj index db75f01..8aceed9 100644 --- a/DirectXMesh/DirectXMesh_Desktop_2019_Win10.vcxproj +++ b/DirectXMesh/DirectXMesh_Desktop_2019_Win10.vcxproj @@ -293,6 +293,7 @@ $(IntDir)$(TargetName).pdb /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) Level4 + true true @@ -317,6 +318,7 @@ $(IntDir)$(TargetName).pdb /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) Level4 + true true @@ -366,6 +368,7 @@ $(IntDir)$(TargetName).pdb /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) Level4 + true true @@ -390,6 +393,7 @@ $(IntDir)$(TargetName).pdb /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) Level4 + true true diff --git a/DirectXMesh/DirectXMesh_Desktop_2022.vcxproj b/DirectXMesh/DirectXMesh_Desktop_2022.vcxproj index 6c02cec..c48a790 100644 --- a/DirectXMesh/DirectXMesh_Desktop_2022.vcxproj +++ b/DirectXMesh/DirectXMesh_Desktop_2022.vcxproj @@ -213,6 +213,7 @@ $(IntDir)$(TargetName).pdb /Zc:__cplusplus %(AdditionalOptions) Level4 + true true @@ -262,6 +263,7 @@ $(IntDir)$(TargetName).pdb /Zc:__cplusplus %(AdditionalOptions) Level4 + true true diff --git a/DirectXMesh/DirectXMesh_Desktop_2022_Win10.vcxproj b/DirectXMesh/DirectXMesh_Desktop_2022_Win10.vcxproj index 7a2f333..0ac94b6 100644 --- a/DirectXMesh/DirectXMesh_Desktop_2022_Win10.vcxproj +++ b/DirectXMesh/DirectXMesh_Desktop_2022_Win10.vcxproj @@ -293,6 +293,7 @@ $(IntDir)$(TargetName).pdb /Zc:__cplusplus %(AdditionalOptions) Level4 + true true @@ -317,6 +318,7 @@ $(IntDir)$(TargetName).pdb /Zc:__cplusplus %(AdditionalOptions) Level4 + true true @@ -366,6 +368,7 @@ $(IntDir)$(TargetName).pdb /Zc:__cplusplus %(AdditionalOptions) Level4 + true true @@ -390,6 +393,7 @@ $(IntDir)$(TargetName).pdb /Zc:__cplusplus %(AdditionalOptions) Level4 + true true diff --git a/DirectXMesh/DirectXMesh_GDK_2019.vcxproj b/DirectXMesh/DirectXMesh_GDK_2019.vcxproj index ace9108..6af10f9 100644 --- a/DirectXMesh/DirectXMesh_GDK_2019.vcxproj +++ b/DirectXMesh/DirectXMesh_GDK_2019.vcxproj @@ -269,6 +269,7 @@ true true Level4 + true 6.0 @@ -338,6 +339,7 @@ true true Level4 + true 6.0 diff --git a/DirectXMesh/DirectXMesh_GDK_2022.vcxproj b/DirectXMesh/DirectXMesh_GDK_2022.vcxproj index a9b1a6a..06d634b 100644 --- a/DirectXMesh/DirectXMesh_GDK_2022.vcxproj +++ b/DirectXMesh/DirectXMesh_GDK_2022.vcxproj @@ -269,6 +269,7 @@ true true Level4 + true 6.0 @@ -338,6 +339,7 @@ true true Level4 + true 6.0 diff --git a/DirectXMesh/DirectXMesh_Windows10_2019.vcxproj b/DirectXMesh/DirectXMesh_Windows10_2019.vcxproj index c4af32f..b1a98fa 100644 --- a/DirectXMesh/DirectXMesh_Windows10_2019.vcxproj +++ b/DirectXMesh/DirectXMesh_Windows10_2019.vcxproj @@ -332,6 +332,7 @@ true /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) Level4 + true Console @@ -376,6 +377,7 @@ true /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) Level4 + true Console diff --git a/DirectXMesh/DirectXMesh_Windows10_2022.vcxproj b/DirectXMesh/DirectXMesh_Windows10_2022.vcxproj index c39d1c8..cb78cf1 100644 --- a/DirectXMesh/DirectXMesh_Windows10_2022.vcxproj +++ b/DirectXMesh/DirectXMesh_Windows10_2022.vcxproj @@ -332,6 +332,7 @@ true /Zc:__cplusplus %(AdditionalOptions) Level4 + true Console @@ -376,6 +377,7 @@ true /Zc:__cplusplus %(AdditionalOptions) Level4 + true Console