Add lib directory to linker paths when using libunwind
authorPetr Hosek <phosek@chromium.org>
Tue, 9 Aug 2016 00:27:19 +0000 (00:27 +0000)
committerPetr Hosek <phosek@chromium.org>
Tue, 9 Aug 2016 00:27:19 +0000 (00:27 +0000)
When using libunwind and not building as standalone project, we
need to add LLVM library directory to the list of linker directories
to ensure it can find libunwind dependency.

Differential Revision: https://reviews.llvm.org/D23287

llvm-svn: 278076

libcxxabi/src/CMakeLists.txt

index b851b4a..163e8ce 100644 (file)
@@ -55,6 +55,9 @@ endif()
 append_if(libraries LIBCXXABI_HAS_C_LIB c)
 
 if (LIBCXXABI_USE_LLVM_UNWINDER)
+  if (NOT LIBCXXABI_BUILT_STANDALONE)
+    link_directories(${LLVM_LIBRARY_DIR})
+  endif()
   list(APPEND libraries unwind)
 else()
   append_if(libraries LIBCXXABI_HAS_GCC_S_LIB gcc_s)