From 2d0ac7eeb0633043e75421c4863beb2b5031063c Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Sun, 15 Mar 2026 04:03:23 -0400 Subject: [PATCH] Disable exceptions and RTTI when building with CMake --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c36e9f26..8de594bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,7 +50,7 @@ if(MSVC) add_link_options(${SAN_FLAGS}) endif() else() - add_compile_options(-Wall -pedantic + add_compile_options(-Wall -pedantic -fno-exceptions -fno-rtti # C++20 allows macros to take zero variadic arguments. # Some versions of Clang don't recognize this, and treat them as a GNU extension. -Wno-gnu-zero-variadic-macro-arguments) @@ -98,6 +98,7 @@ else() ERROR_VARIABLE git_err ERROR_STRIP_TRAILING_WHITESPACE RESULT_VARIABLE result) if(NOT result EQUAL 0) + # Note that this happens e.g. when building from a tarball, so it shouldn't fail the build! message(CHECK_FAIL "error ${result} from Git:") list(APPEND CMAKE_MESSAGE_INDENT " ") message("${git_err}")