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

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 14 22:53:35 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL295153: [libunwind][CMake] Use libc++ headers when available (authored by phosek).

Changed prior to commit:
  https://reviews.llvm.org/D29800?vs=87915&id=88490#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D29800

Files:
  libunwind/trunk/CMakeLists.txt


Index: libunwind/trunk/CMakeLists.txt
===================================================================
--- libunwind/trunk/CMakeLists.txt
+++ libunwind/trunk/CMakeLists.txt
@@ -282,4 +282,24 @@
 
 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_DEFAULT "${LIBUNWIND_LIBCXX_INCLUDES_INTERNAL}")
+endif()
+
+set(LIBUNWIND_CXX_INCLUDE_PATHS "${LIBUNWIND_CXX_INCLUDE_PATHS_DEFAULT}" CACHE PATH
+    "Paths to C++ header directories separated by ';'.")
+
+if (NOT LIBUNWIND_CXX_INCLUDE_PATHS STREQUAL "")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nostdinc++")
+  include_directories("${LIBUNWIND_CXX_INCLUDE_PATHS}")
+endif()
+
 add_subdirectory(src)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29800.88490.patch
Type: text/x-patch
Size: 985 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170215/9bf99c19/attachment.bin>


More information about the llvm-commits mailing list