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

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 17 14:34:16 PST 2017


phosek updated this revision to Diff 123423.
phosek marked an inline comment as done.

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)
+      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


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


More information about the llvm-commits mailing list