From 2ac8408fef12d1f82b16719b675b29bf4a23c598 Mon Sep 17 00:00:00 2001 From: R-Goc Date: Thu, 5 Dec 2024 11:52:06 +0100 Subject: [PATCH] CMake: Fix Windows exceptions flag This commit changes the exception flag to match the description and turn off exceptions. This matches the behavior of -fno-exceptions. However, on Windows SEH exceptions are always available, and there's no easy way to turn them off. This flag should also suppress previous /EHsc flags, if they get automatically set by cmake. Reference: https://learn.microsoft.com/en-us/cpp/build/reference/eh-exception-handling-model?view=msvc-170 --- Meta/CMake/common_compile_options.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Meta/CMake/common_compile_options.cmake b/Meta/CMake/common_compile_options.cmake index f30caf33339..72918d691fd 100644 --- a/Meta/CMake/common_compile_options.cmake +++ b/Meta/CMake/common_compile_options.cmake @@ -56,7 +56,7 @@ endif() if (MSVC) add_cxx_compile_options(/W4) # disable exceptions - add_cxx_compile_options(/EHsc) + add_cxx_compile_options(/EHs-) # disable floating-point expression contraction add_cxx_compile_options(/fp:precise) else()