summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Racine <bass_dr@hotmail.com>2026-09-13 14:21:24 -0400
committerGitHub <noreply@github.com>2026-09-13 18:21:24 +0000
commitb81187db3605ad5da620b925b6c100cd16ddaa83 (patch)
tree26c89ccc89f7425b54573be164bd9a2dc101c162
parent3cfe4ddffb5e4ca0fac13369aa09defe648c9895 (diff)
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.
-rw-r--r--soh/CMakeLists.txt3
1 files changed, 2 insertions, 1 deletions
diff --git a/soh/CMakeLists.txt b/soh/CMakeLists.txt
index 3e1c432fe..16551e859 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()