diff options
author | Don Hinton <hintonda@gmail.com> | 2018-01-22 19:15:06 +0000 |
---|---|---|
committer | Don Hinton <hintonda@gmail.com> | 2018-01-22 19:15:06 +0000 |
commit | bb7121ae291d192dd6d4b3c6a4fe5e79d5f0af58 (patch) | |
tree | ec008459a713b9d282d4f49b8108fea54edda0ab /libunwind/CMakeLists.txt | |
parent | cc67e92405b282a9e83aac83b00771af733e52ec (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.txt | 3 |
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}") |