[PATCH] D96433: llvm cmake: Fix NATIVE build when a toolchain file is already defined

Tim Renouf via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 10 12:05:29 PST 2021


tpr added a comment.

In D96433#2554813 <https://reviews.llvm.org/D96433#2554813>, @smeenai wrote:

> The NATIVE build is also used for cross-compilation scenarios (e.g. you're building on Windows but targeting Linux, but you still need tools like tablegen to be built targeting Windows), and for those cases, using the same CMAKE_TOOLCHAIN_FILE as the main build is completely incorrect.
>
> What I've done to handle situations like this is set the `CROSS_TOOLCHAIN_FLAGS_NATIVE` cache variable to include the desired toolchain file for the NATIVE build (and any other desired CMake settings as well). Does that work for you? Something like `-DCROSS_TOOLCHAIN_FLAGS_NATIVE="-DCMAKE_TOOLCHAIN_FILE=/path/to/your/toolchain/file"` should do the trick.

Thanks; I will try that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96433



More information about the llvm-commits mailing list