From a990f8d87d0c22015afb5a8630d1d37e2a5d1fac Mon Sep 17 00:00:00 2001 From: Misa Date: Thu, 27 Jun 2024 17:24:36 -0700 Subject: [PATCH] Fix wrong comment on disabling MSVC exceptions `/EHsc` does not actually disable exceptions on MSVC, it only makes the compiler assume that `extern "C"` functions never throw C++ exceptions. We had a discussion on Discord about actually disabling exceptions, and from research, that requires defining `_HAS_EXCEPTIONS=0`, but it's unsupported and undocumented so we deemed the benefits not worth it. Thus, we will stay with `/EHsc`. But the comment still has to be updated. [skip ci] --- desktop_version/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/desktop_version/CMakeLists.txt b/desktop_version/CMakeLists.txt index fbb33fef..947e19b5 100644 --- a/desktop_version/CMakeLists.txt +++ b/desktop_version/CMakeLists.txt @@ -287,7 +287,8 @@ endif() if(MSVC) # MSVC doesn't have /std:c99 or /std:c++98 switches! - # Disable exceptions + # MSVC does not officially support disabling exceptions, + # so this is as far as we are willing to go to disable them. string(REGEX REPLACE "/EH[a-z]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")