[PATCH] D126313: [CMake] Don't pass CMAKE_C(XX)_COMPILER to the nested NATIVE build

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 27 14:47:46 PDT 2022


mstorsjo added a comment.

In D126313#3543242 <https://reviews.llvm.org/D126313#3543242>, @phosek wrote:

> Thanks for clarification, that helps and I understand the motivation now.
>
> Not passing through `CMAKE_C(XX)_COMPILER` to the sub-build makes sense, but not setting `CMAKE_C(XX)_COMPILER` may be a problem. For example, our bots there's no host compiler (intentionally), we fetch the host compiler before the configuration step and pass it explicitly via `CMAKE_C(XX)_COMPILER` so in our case, with this change the sub-build would fail to find a compiler. We might need another way to set the compiler for the sub-build.

So in your case, you use the same e.g. clang executable for both host and cross compilation, and just control it with `CMAKE_CXX_COMPILER_TARGET` on the cross side, and by omitting that option in the native part, it defaults to building for the host?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126313/new/

https://reviews.llvm.org/D126313



More information about the llvm-commits mailing list