From b81187db3605ad5da620b925b6c100cd16ddaa83 Mon Sep 17 00:00:00 2001 From: David Racine Date: Sun, 13 Sep 2026 14:21:24 -0400 Subject: [PATCH] Keep /EHsc when clearing the MSVC default flags (#7185) The MSVC block drops CMake's defaults wholesale, and /EHsc goes with them, so Windows builds compile every try/catch without unwind semantics - cl only warns (C4530). soh and libultraship have 25 of them between them, including the config and archive paths in OTRGlobals, where a throw would skip destructors. clang-cl refuses outright rather than warning, which is how this surfaced. --- soh/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/soh/CMakeLists.txt b/soh/CMakeLists.txt index 3e1c432fef..16551e8598 100644 --- a/soh/CMakeLists.txt +++ b/soh/CMakeLists.txt @@ -59,7 +59,8 @@ if(MSVC) set(CMAKE_C_FLAGS "") set(CMAKE_C_FLAGS_DEBUG "") set(CMAKE_C_FLAGS_RELEASE "") - set(CMAKE_CXX_FLAGS "") + # Keep /EHsc: the code uses try/catch. + set(CMAKE_CXX_FLAGS "/EHsc") set(CMAKE_CXX_FLAGS_DEBUG "") set(CMAKE_CXX_FLAGS_RELEASE "") endif()