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

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 10 11:16:00 PST 2021


smeenai requested changes to this revision.
smeenai added a comment.
This revision now requires changes to proceed.

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.


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