summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt1
-rw-r--r--lib/CMakeLists.txt4
2 files changed, 3 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0b730529c..0ac7c8c14 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -158,6 +158,7 @@ option(LIBCXX_ENABLE_ABI_LINKER_SCRIPT
# Build libc++abi with libunwind. We need this option to determine whether to
# link with libunwind or libgcc_s while running the test cases.
option(LIBCXXABI_USE_LLVM_UNWINDER "Build and use the LLVM unwinder." OFF)
+option(LIBCXXABI_ENABLE_STATIC_UNWINDER "Statically link the LLVM unwinder." OFF)
# Target options --------------------------------------------------------------
option(LIBCXX_BUILD_32_BITS "Build 32 bit libc++." ${LLVM_BUILD_32_BITS})
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index e11ff2627..231ccda61 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -89,9 +89,9 @@ add_library_flags_if(LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB atomic)
# Add the unwinder library.
if (LIBCXXABI_USE_LLVM_UNWINDER)
- if (TARGET unwind_shared)
+ if (NOT LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_shared OR HAVE_LIBUNWIND))
add_interface_library(unwind_shared)
- elseif (TARGET unwind_static)
+ elseif (LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_static OR HAVE_LIBUNWIND))
add_interface_library(unwind_static)
else()
add_interface_library(unwind)