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 | 98762d639111593699b509ab6bc20ebed0e41352 (patch) | |
tree | 1f43a339347fb09ed60d4eb97bb87a36d3e70fae | |
parent | 2b4c5e067b7259ae5d60553c62e309a1780df570 (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
git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@323141 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | CMakeLists.txt | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c6a2e6..3a132be 100644 --- a/CMakeLists.txt +++ b/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}") |