summaryrefslogtreecommitdiffstats
path: root/libunwind
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2017-02-09 02:20:25 +0000
committerPetr Hosek <phosek@chromium.org>2017-02-09 02:20:25 +0000
commit34f63ccc40227e370f1b6c2364af9ae43c2b7e31 (patch)
tree408846935ea17a5af90c5d6514639a9205fadfff /libunwind
parentb494288b9e57a1517dc5305a78f947b428f3ea4d (diff)
downloadbcm5719-llvm-34f63ccc40227e370f1b6c2364af9ae43c2b7e31.tar.gz
bcm5719-llvm-34f63ccc40227e370f1b6c2364af9ae43c2b7e31.zip
[libunwind][CMake] Use libc++ headers when available
libunwind depends on C++ library headers. When building libunwind as part of LLVM and libc++ is available, use its headers. Differential Revision: https://reviews.llvm.org/D29573 llvm-svn: 294554
Diffstat (limited to 'libunwind')
-rw-r--r--libunwind/CMakeLists.txt19
1 files changed, 19 insertions, 0 deletions
diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt
index 3ba4b65d175..7f1a118958b 100644
--- a/libunwind/CMakeLists.txt
+++ b/libunwind/CMakeLists.txt
@@ -282,4 +282,23 @@ endif()
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 "")
+ include_directories("${LIBUNWIND_CXX_INCLUDE_PATHS}")
+endif()
+
add_subdirectory(src)
OpenPOWER on IntegriCloud