[PATCH] D39029: [CMake] Passthrough CMAKE_SYSROOT to external projects

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 7 17:46:15 PST 2017


phosek added a comment.

In https://reviews.llvm.org/D39029#918669, @beanz wrote:

> Sorry I've been bad at staying on top of your patches.
>
> I think this shouldn't be an unconditional passthrough. I can imagine a situation where at least for the runtimes you might want different values set for different targets.
>
> You've done most of the work in that area. What do you think?


We already use `CMAKE_SYSROOT` in build for our targets (here https://github.com/llvm-mirror/clang/blob/master/cmake/caches/Fuchsia-stage2.cmake#L45). The way this works is that the `-DCMAKE_SYSROOT=...` value we set in our cache file will be eventually passed to this function in `${ARG_CMAKE_ARGS}` variable and since that one comes after the one I've added, CMake will pick that value as the final one. I admit it's not the prettiest solution though. I could change it to only set `-DCMAKE_SYSROOT` if it's defined and it's not already set in `${ARG_CMAKE_ARGS}`, would you prefer that solution?


Repository:
  rL LLVM

https://reviews.llvm.org/D39029





More information about the llvm-commits mailing list