summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2018-04-04 16:27:33 +0000
committerPetr Hosek <phosek@chromium.org>2018-04-04 16:27:33 +0000
commit97c4d2222f7471e91d5017aaa5692c65e8fe1c74 (patch)
tree507b0a7c049fe0e4514b42ae291ca64244a5a4ff /CMakeLists.txt
parentfc9c3892b63243e837c19e3d29e229394f4254d5 (diff)
[CMake] Support statically linked libc++abi and libunwind
This expands the CMake check to handle both statically and dynamically linked version of libc++abi and libunwind and matches the implemnetation used elsewhere in LLVM. Differential Revision: https://reviews.llvm.org/D45242 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@329205 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt8
1 files changed, 6 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a02ef9532..dab56af5c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -152,11 +152,15 @@ endif()
if (SANITIZER_CXX_ABI_LIBNAME STREQUAL "libcxxabi")
if (SANITIZER_CXX_ABI_INTREE)
- if (TARGET unwind_shared OR HAVE_LIBUNWIND)
+ if (NOT LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_shared OR HAVE_LIBUNWIND))
list(APPEND SANITIZER_CXX_ABI_LIBRARY unwind_shared)
+ elseif (LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_static OR HAVE_LIBUNWIND))
+ list(APPEND SANITIZER_CXX_ABI_LIBRARY unwind_static)
endif()
- if (TARGET cxxabi_shared OR HAVE_LIBCXXABI)
+ if (NOT LIBCXX_ENABLE_STATIC_ABI_LIBRARY AND (TARGET cxxabi_shared OR HAVE_LIBCXXABI))
list(APPEND SANITIZER_CXX_ABI_LIBRARY cxxabi_shared)
+ elseif (LIBCXX_ENABLE_STATIC_ABI_LIBRARY AND (TARGET cxxabi_static OR HAVE_LIBCXXABI))
+ list(APPEND SANITIZER_CXX_ABI_LIBRARY cxxabi_static)
endif()
else()
list(APPEND SANITIZER_CXX_ABI_LIBRARY "c++abi")