summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDon Hinton <hintonda@gmail.com>2018-01-22 19:41:05 +0000
committerDon Hinton <hintonda@gmail.com>2018-01-22 19:41:05 +0000
commit16e9d9f81c406af53de6f22958868469977c3de1 (patch)
tree56eb86ac65404bcce18a781b0eff8475eb054851
parent0d2ebaae8dbb50d5a28a86f107de219b9a5320c0 (diff)
downloadlibcxxabi-16e9d9f81c406af53de6f22958868469977c3de1.tar.gz
[cmake] [libcxxabi] Fix find_path() problems when cross compiling
When CMAKE_SYSROOT or CMAKE_FIND_ROOT_PATH is set, cmake recommends setting CMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY globally which means find_path() always prepends CMAKE_SYSROOT or CMAKE_FIND_ROOT_PATH to all paths used in the search. However, these find_path() invocations are looking for paths in the libcxx and libunwind projects on the host system, not the target system, which can be done by passing NO_CMAKE_FIND_ROOT_PATH. Differential Revision: https://reviews.llvm.org/D41623 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@323145 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--CMakeLists.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dd43da2..35eb130 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -115,6 +115,7 @@ find_path(
${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBCXX_INCLUDES}
${LIBCXXABI_LIBCXX_INCLUDE_DIRS}
${LLVM_INCLUDE_DIR}/c++/v1
+ NO_CMAKE_FIND_ROOT_PATH
)
set(LIBCXXABI_LIBCXX_INCLUDES "${LIBCXXABI_LIBCXX_INCLUDES}" CACHE PATH
@@ -127,6 +128,7 @@ find_path(
${LIBCXXABI_LIBCXX_INCLUDES}/../
${LIBCXXABI_LIBCXX_SRC_DIRS}
NO_DEFAULT_PATH
+ NO_CMAKE_FIND_ROOT_PATH
)
if (LIBCXXABI_LIBCXX_PATH STREQUAL "LIBCXXABI_LIBCXX_PATH-NOTFOUND")
@@ -425,6 +427,7 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
${LLVM_MAIN_SRC_DIR}/projects/libunwind/include
${LLVM_MAIN_SRC_DIR}/runtimes/libunwind/include
NO_DEFAULT_PATH
+ NO_CMAKE_FIND_ROOT_PATH
)
if (LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL-NOTFOUND")