Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

Commit

Permalink
[CMake][libcxxabi] Support merging objects when statically linking un…
Browse files Browse the repository at this point in the history
…winder

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@318563 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
petrhosek committed Nov 17, 2017
1 parent 66224e1 commit 3568730
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3568730

Please sign in to comment.