aboutsummaryrefslogtreecommitdiff
path: root/backend/CMakeLists.txt
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-01 13:01:07 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-01 13:01:07 +0800
commitb4d1ddb99e1305f6ea6217e7570dda2a94b16e51 (patch)
treefb4501033e8d03f06511bff638e0929c4114f465 /backend/CMakeLists.txt
parentfd8770b01a7a3ae85ba85fb43b21803c88593ad7 (diff)
downloadrcc-project-b4d1ddb99e1305f6ea6217e7570dda2a94b16e51.tar.gz
rcc-project-b4d1ddb99e1305f6ea6217e7570dda2a94b16e51.tar.xz
[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.
Diffstat (limited to 'backend/CMakeLists.txt')
-rw-r--r--backend/CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
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()