[PATCH] D39949: [CMake][libcxxabi] Support merging archives when statically linking unwinder

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 16 20:32:40 PST 2017


phosek updated this revision to Diff 123288.

Repository:
  rL LLVM

https://reviews.llvm.org/D39949

Files:
  src/CMakeLists.txt


Index: src/CMakeLists.txt
===================================================================
--- src/CMakeLists.txt
+++ src/CMakeLists.txt
@@ -151,7 +151,13 @@
 
 # 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)
+      set(cxxabi_static_sources ${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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39949.123288.patch
Type: text/x-patch
Size: 793 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171117/bf689129/attachment.bin>


More information about the llvm-commits mailing list