[PATCH] D48459: Respect CMAKE_SYSROOT and CMAKE_CROSSCOMPILING when searching for libxml2.

Stephen Hines via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 26 21:13:55 PDT 2018


srhines added a comment.

In https://reviews.llvm.org/D48459#1143012, @smeenai wrote:

> Actually, I would imagine that if you're cross-compiling or using a custom sysroot, you should probably also specify CMAKE_FIND_ROOT_PATH and set CMAKE_FIND_ROOT_PATH_MODE_PACKAGE to ONLY, to limit all these searches to the desired directories?
>
> (I'm actually playing around with a bunch of this stuff myself right now. I'm curious about your CMake setup for a custom sysroot or cross-compilation and what issues you've come across.)


https://android.googlesource.com/toolchain/llvm_android/+/master/build.py is what we use to wrap all the CMake invocations that we do to create Android's toolchain. We have to currently iterate because we need to create multiple different runtimes for all of our supported architectures. I don't think we have hit many other problems. This is something that is only affecting some of our users, but I wanted to try to fix it better than "just uninstall libxml2".

As far as this patch goes, I am trying to experiment with those other variables you mentioned. If that is enough to solve all of our problems, I'm probably just going to abandon these two patches. CMake remains terribly painful to use, especially for these cross-compiling scenarios, which are not that well-documented in general.


Repository:
  rC Clang

https://reviews.llvm.org/D48459





More information about the cfe-commits mailing list