Skip to content

Commit

Permalink
[cmake] [libcxx] Fix find_path() problems when cross compiling.
Browse files Browse the repository at this point in the history
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
libcxxabi 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/D41622

llvm-svn: 323143
  • Loading branch information
donhinton committed Jan 22, 2018
1 parent 7c70d9d commit 98bb420
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libcxx/CMakeLists.txt
Expand Up @@ -123,6 +123,7 @@ if (LIBCXX_CXX_ABI STREQUAL "default")
${LLVM_MAIN_SRC_DIR}/runtimes/libcxxabi/include
${LLVM_MAIN_SRC_DIR}/../libcxxabi/include
NO_DEFAULT_PATH
NO_CMAKE_FIND_ROOT_PATH
)
if (LIBCXX_TARGETING_MSVC)
# FIXME: Figure out how to configure the ABI library on Windows.
Expand Down

0 comments on commit 98bb420

Please sign in to comment.