summaryrefslogtreecommitdiffstats
path: root/libcxxabi/src
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2017-11-17 22:49:39 +0000
committerPetr Hosek <phosek@chromium.org>2017-11-17 22:49:39 +0000
commit56a1f071567fdfc69a18191bc3894980b36a60c7 (patch)
tree582ee3d2a2f23323556372dfe2fe8840124034c4 /libcxxabi/src
parentba996aba01192f4b102f303dccb34111b9be343d (diff)
downloadbcm5719-llvm-56a1f071567fdfc69a18191bc3894980b36a60c7.tar.gz
bcm5719-llvm-56a1f071567fdfc69a18191bc3894980b36a60c7.zip
[CMake][libcxxabi] Support merging objects when statically linking unwinder
When using LLVM unwinder and static unwinder option is set, merge libunwind and libc++abi objects into a single archive. libc++ already supports merging libc++abi.a and libc++.a into a single archive; with this change, it is possible to also include libunwind.a in the same archive which is useful when doing static link and using libc++ as a default C++ library and compiler-rt as a default runtime library. Differential Revision: https://reviews.llvm.org/D39949 llvm-svn: 318563
Diffstat (limited to 'libcxxabi/src')
-rw-r--r--libcxxabi/src/CMakeLists.txt8
1 files changed, 7 insertions, 1 deletions
diff --git a/libcxxabi/src/CMakeLists.txt b/libcxxabi/src/CMakeLists.txt
index adcc412880c..23e8c8835c7 100644
--- a/libcxxabi/src/CMakeLists.txt
+++ b/libcxxabi/src/CMakeLists.txt
@@ -151,7 +151,13 @@ endif()
# Build the static library.
if (LIBCXXABI_ENABLE_STATIC)
- add_library(cxxabi_static STATIC $<TARGET_OBJECTS:cxxabi_objects>)
+ set(cxxabi_static_sources $<TARGET_OBJECTS:cxxabi_objects>)
+ if (LIBCXXABI_USE_LLVM_UNWINDER AND LIBCXXABI_ENABLE_STATIC_UNWINDER)
+ if (TARGET unwind_static OR HAVE_LIBUNWIND)
+ list(APPEND cxxabi_static_sources $<TARGET_OBJECTS:unwind_objects>)
+ endif()
+ endif()
+ add_library(cxxabi_static STATIC ${cxxabi_static_sources})
target_link_libraries(cxxabi_static ${LIBCXXABI_LIBRARIES})
set_target_properties(cxxabi_static
PROPERTIES
OpenPOWER on IntegriCloud