[PATCH] D29574: [libcxxabi][CMake] Support in-tree libunwind when building as part of runtimes

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 5 22:17:14 PST 2017


phosek created this revision.
Herald added a subscriber: mgorny.

When building as part of runtimes, there is no predefined order in which the runtimes are loaded, so the targets from other projects might not be available. We need to rely on HAVE_<name> variables instead in that case.


Repository:
  rL LLVM

https://reviews.llvm.org/D29574

Files:
  src/CMakeLists.txt


Index: src/CMakeLists.txt
===================================================================
--- src/CMakeLists.txt
+++ src/CMakeLists.txt
@@ -61,9 +61,9 @@
   # Prefer using the in-tree version of libunwind, either shared or static. If
   # none are found fall back to using -lunwind.
   # FIXME: Is it correct to prefer the static version of libunwind?
-  if (TARGET unwind_shared)
+  if (TARGET unwind_shared OR HAVE_LIBUNWIND)
     list(APPEND libraries unwind_shared)
-  elseif(TARGET unwind_static)
+  elseif(TARGET unwind_static OR HAVE_LIBUNWIND)
     list(APPEND libraries unwind_static)
   else()
     list(APPEND libraries unwind)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29574.87185.patch
Type: text/x-patch
Size: 643 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170206/47c5036f/attachment.bin>


More information about the llvm-commits mailing list