From b4d1ddb99e1305f6ea6217e7570dda2a94b16e51 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Sat, 1 Aug 2026 13:01:07 +0800 Subject: [CMake] Match LLVM EH and RTTI defaults Disable C++ exceptions and RTTI by default while retaining explicit, validated opt-in switches. Replace the arena's exception syntax with an RAII construction guard so both configurations share one implementation. --- backend/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'backend/CMakeLists.txt') diff --git a/backend/CMakeLists.txt b/backend/CMakeLists.txt index 2d5cc82..0f983d0 100644 --- a/backend/CMakeLists.txt +++ b/backend/CMakeLists.txt @@ -44,6 +44,12 @@ include(RCCBackendDeveloperTools) option(RCC_BACKEND_BUILD_TESTS "Build RCC Backend tests" "${BUILD_TESTING}") option(RCC_BACKEND_WARNINGS_AS_ERRORS "Treat compiler warnings as errors" OFF) option(RCC_BACKEND_ENABLE_CLANG_TIDY "Run clang-tidy during each compilation" OFF) +option(RCC_BACKEND_ENABLE_EH "Enable C++ exception handling" OFF) +option(RCC_BACKEND_ENABLE_RTTI "Enable C++ run-time type information" OFF) + +if(RCC_BACKEND_ENABLE_EH AND NOT RCC_BACKEND_ENABLE_RTTI) + message(FATAL_ERROR "RCC Backend exception handling requires RTTI") +endif() rcc_backend_initialize_toolchain() -- cgit v1.2.3