Skip to content

Commit e571e3f

Browse files
[libc++abi] Introduce LIBCXXABI_ENABLE_DEMANGLER
1 parent e9de91e commit e571e3f

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

libcxxabi/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ include(CMakeDependentOption)
4646
include(HandleCompilerRT)
4747

4848
# Define options.
49+
option(LIBCXXABI_ENABLE_DEMANGLER
50+
"Provide support for demangling in the runtime.
51+
When disabled, libc++abi does not support the name demangler API." ON)
4952
option(LIBCXXABI_ENABLE_EXCEPTIONS
5053
"Provide support for exceptions in the runtime.
5154
When disabled, libc++abi does not support stack unwinding and other exceptions-related features." ON)
@@ -129,8 +132,6 @@ option(LIBCXXABI_BAREMETAL "Build libc++abi for baremetal targets." OFF)
129132
# The default terminate handler attempts to demangle uncaught exceptions, which
130133
# causes extra I/O and demangling code to be pulled in.
131134
option(LIBCXXABI_SILENT_TERMINATE "Set this to make the terminate handler default to a silent alternative" OFF)
132-
option(LIBCXXABI_NON_DEMANGLING_TERMINATE "Set this to make the terminate handler
133-
avoid demangling" OFF)
134135

135136
if (NOT LIBCXXABI_ENABLE_SHARED AND NOT LIBCXXABI_ENABLE_STATIC)
136137
message(FATAL_ERROR "libc++abi must be built as either a shared or static library.")
@@ -431,7 +432,7 @@ if (LIBCXXABI_SILENT_TERMINATE)
431432
add_definitions(-DLIBCXXABI_SILENT_TERMINATE)
432433
endif()
433434

434-
if (LIBCXXABI_NON_DEMANGLING_TERMINATE)
435+
if (NOT LIBCXXABI_ENABLE_DEMANGLER)
435436
add_definitions(-DLIBCXXABI_NON_DEMANGLING_TERMINATE)
436437
endif()
437438

libcxxabi/src/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ set(LIBCXXABI_SOURCES
33
# C++ABI files
44
cxa_aux_runtime.cpp
55
cxa_default_handlers.cpp
6-
cxa_demangle.cpp
76
cxa_exception_storage.cpp
87
cxa_guard.cpp
98
cxa_handlers.cpp
@@ -19,6 +18,12 @@ set(LIBCXXABI_SOURCES
1918
private_typeinfo.cpp
2019
)
2120

21+
if (LIBCXXABI_ENABLE_DEMANGLER)
22+
list(APPEND LIBCXXABI_SOURCES
23+
cxa_demangle.cpp
24+
)
25+
endif()
26+
2227
if (LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS)
2328
list(APPEND LIBCXXABI_SOURCES
2429
stdlib_new_delete.cpp

0 commit comments

Comments
 (0)