[PATCH] D41623: [cmake] Fix path problems when cross compiling.

Don Hinton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 28 21:34:42 PST 2017


hintonda created this revision.
hintonda added reviewers: EricWF, compnerd, phosek, beanz.
Herald added a subscriber: mgorny.

When cross compiling, users can set CMAKE_FIND_ROOT_PATH to
the sysroot of the TARGET system which adds the sysroot prefix to the
paths used in the FIND_XXX commands.  Since these FIND_PATH commands
use absolute paths found on the HOST system, pass
NO_CMAKE_FIND_ROOT_PATH to keep the prefix from being added.


Repository:
  rCXXA libc++abi

https://reviews.llvm.org/D41623

Files:
  CMakeLists.txt


Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -115,6 +115,7 @@
         ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBCXX_INCLUDES}
         ${LIBCXXABI_LIBCXX_INCLUDE_DIRS}
         ${LLVM_INCLUDE_DIR}/c++/v1
+  NO_CMAKE_FIND_ROOT_PATH
   )
 
 set(LIBCXXABI_LIBCXX_INCLUDES "${LIBCXXABI_LIBCXX_INCLUDES}" CACHE PATH
@@ -127,6 +128,7 @@
         ${LIBCXXABI_LIBCXX_INCLUDES}/../
         ${LIBCXXABI_LIBCXX_SRC_DIRS}
   NO_DEFAULT_PATH
+  NO_CMAKE_FIND_ROOT_PATH
   )
 
 if (LIBCXXABI_LIBCXX_PATH STREQUAL "LIBCXXABI_LIBCXX_PATH-NOTFOUND")
@@ -425,6 +427,7 @@
           ${LLVM_MAIN_SRC_DIR}/projects/libunwind/include
           ${LLVM_MAIN_SRC_DIR}/runtimes/libunwind/include
     NO_DEFAULT_PATH
+    NO_CMAKE_FIND_ROOT_PATH
   )
 
   if (LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL-NOTFOUND")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41623.128315.patch
Type: text/x-patch
Size: 913 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171229/327ba37c/attachment.bin>


More information about the cfe-commits mailing list