hintonda added a comment.

In https://reviews.llvm.org/D41623#965271, @compnerd wrote:

> I think that it might be better to handle this as a single global change:
>
>   if(CMAKE_FIND_ROOT_PATH)
>     set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)
>   endif()


When I cross compile on Darwin and target Linux, I set sysroot and only want 
look for headers and libs in the new sysroot, not the host system.  However, in 
this case, I want to look for the just built headers.  This change helps 
support this.

As for global settings, this is what I'm setting in my toolchain file:

  SET(CMAKE_FIND_ROOT_PATH "${sysroot}" CACHE STRING "" FORCE)
  # adjust the default behavior of the FIND_XXX() commands:
  # search headers and libraries in the target environment, search
  # programs in the host environment
  set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER CACHE STRING "" FORCE)
  set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY CACHE STRING "" FORCE)
  set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY CACHE STRING "" FORCE)


Repository:
  rCXXA libc++abi

https://reviews.llvm.org/D41623



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

Reply via email to