Depend directly on unwind when not building standalone
authorPetr Hosek <phosek@chromium.org>
Tue, 9 Aug 2016 21:28:52 +0000 (21:28 +0000)
committerPetr Hosek <phosek@chromium.org>
Tue, 9 Aug 2016 21:28:52 +0000 (21:28 +0000)
When using libunwind and not building as standalone project, we
can directly depend on the unwind library target.

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

llvm-svn: 278169

libcxxabi/src/CMakeLists.txt

index 163e8ce..3af703c 100644 (file)
@@ -56,9 +56,14 @@ append_if(libraries LIBCXXABI_HAS_C_LIB c)
 
 if (LIBCXXABI_USE_LLVM_UNWINDER)
   if (NOT LIBCXXABI_BUILT_STANDALONE)
-    link_directories(${LLVM_LIBRARY_DIR})
+    if (LIBUNWIND_ENABLE_SHARED)
+      list(APPEND libraries unwind_shared)
+    else()
+      list(APPEND libraries unwind_static)
+    endif()
+  else()
+    list(APPEND libraries unwind)
   endif()
-  list(APPEND libraries unwind)
 else()
   append_if(libraries LIBCXXABI_HAS_GCC_S_LIB gcc_s)
 endif()