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.
This commit is contained in:
David Racine
2026-09-13 14:21:24 -04:00
committed by GitHub
parent 3cfe4ddffb
commit b81187db36
+2 -1
View File
@@ -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()