[PATCH] D29573: [libunwind][CMake] Use libc++ headers when available

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


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

libunwind depends on C++ library headers. When building libunwind as part of LLVM and libc++ is available, use its headers.


Repository:
  rL LLVM

https://reviews.llvm.org/D29573

Files:
  CMakeLists.txt


Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -282,4 +282,21 @@
 
 include_directories(include)
 
+find_path(
+  LIBUNWIND_LIBCXX_INCLUDES_INTERNAL
+  __libcpp_version
+  PATHS ${LLVM_MAIN_SRC_DIR}/projects/libcxx/include
+        ${LLVM_MAIN_SRC_DIR}/runtimes/libcxx/include
+  NO_DEFAULT_PATH
+)
+if ((NOT LIBUNWIND_STANDALONE_BUILD OR HAVE_LIBCXX) AND
+    IS_DIRECTORY "${LIBUNWIND_LIBCXX_INCLUDES_INTERNAL}")
+  set(LIBUNWIND_CXX_INCLUDE_PATHS "${LIBUNWIND_LIBCXX_INCLUDES_INTERNAL}")
+endif()
+
+set(LIBUNWIND_CXX_INCLUDE_PATHS "${LIBUNWIND_CXX_INCLUDE_PATHS}" CACHE PATH
+    "Paths to C++ header directories separated by ';'." FORCE)
+
+include_directories("${LIBUNWIND_CXX_INCLUDE_PATHS}")
+
 add_subdirectory(src)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29573.87183.patch
Type: text/x-patch
Size: 809 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170206/5b21d76b/attachment.bin>


More information about the llvm-commits mailing list