diff options
author | Dan Albert <danalbert@google.com> | 2014-07-14 17:00:29 +0000 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2014-07-14 17:00:29 +0000 |
commit | db8f33571359aa257861718139982ff943b5257d (patch) | |
tree | e55be9b2767c3ceffdac9a1fbf2274a7365eae35 /src/CMakeLists.txt | |
parent | 3110ea34663a90a1a568864c266d7c4498df2bde (diff) |
Fix for libc++abi when using -Wl,--as-needed.
The cmake files for libc++abi and the unwinder weren't linking against
libpthread or an unwind library. If the tests were linked with
-Wl,--as-needed, these libraries wouldn't be linked, causing them to
fail.
Patch contributed by İsmail Dönmez.
git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@212958 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 81b61ef..a3fdf6c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -47,6 +47,13 @@ include_directories("${LIBCXXABI_LIBCXX_INCLUDES}") # Generate library list. set(libraries ${LIBCXXABI_CXX_ABI_LIBRARIES}) append_if(libraries LIBCXXABI_HAS_C_LIB c) +append_if(libraries LIBCXXABI_HAS_PTHREAD_LIB pthread) + +if (LIBCXXABI_USE_LLVM_UNWINDER) + list(APPEND libraries unwind) +else() + append_if(libraries LIBCXXABI_HAS_GCC_EH_LIB gcc_eh) +endif() target_link_libraries(cxxabi ${libraries}) |