summaryrefslogtreecommitdiff
path: root/libunwind/CMakeLists.txt
diff options
context:
space:
mode:
authorDon Hinton <hintonda@gmail.com>2018-01-22 19:15:06 +0000
committerDon Hinton <hintonda@gmail.com>2018-01-22 19:15:06 +0000
commitbb7121ae291d192dd6d4b3c6a4fe5e79d5f0af58 (patch)
treeec008459a713b9d282d4f49b8108fea54edda0ab /libunwind/CMakeLists.txt
parentcc67e92405b282a9e83aac83b00771af733e52ec (diff)
[cmake] [libunwind] 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, this find_path() invocation is looking for a path in the libcxx project 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/D41621
Diffstat (limited to 'libunwind/CMakeLists.txt')
-rw-r--r--libunwind/CMakeLists.txt3
1 files changed, 2 insertions, 1 deletions
diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt
index 3c6a2e67721..3a132be5496 100644
--- a/libunwind/CMakeLists.txt
+++ b/libunwind/CMakeLists.txt
@@ -329,7 +329,8 @@ find_path(
PATHS ${LLVM_MAIN_SRC_DIR}/projects/libcxx/include
${LLVM_MAIN_SRC_DIR}/runtimes/libcxx/include
NO_DEFAULT_PATH
-)
+ NO_CMAKE_FIND_ROOT_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}")