Author: dhinton
Date: Mon Jan 22 11:15:06 2018
New Revision: 323141

URL: http://llvm.org/viewvc/llvm-project?rev=323141&view=rev
Log:
[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

Modified:
    libunwind/trunk/CMakeLists.txt

Modified: libunwind/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/CMakeLists.txt?rev=323141&r1=323140&r2=323141&view=diff
==============================================================================
--- libunwind/trunk/CMakeLists.txt (original)
+++ libunwind/trunk/CMakeLists.txt Mon Jan 22 11:15:06 2018
@@ -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}")


_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to