Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cargo: Use the right LLVM tools and arguments for MSVC cross-compilation
`xbuild` uses the headers from `xwin` to support cross-compiling, but doesn't fully replicate the other setup steps that it proposes to provide a valid and working cross-compilation setup to MSVC. We need to make the following changes: - `clang-cl` must be used (a `clang` driver with `cl.exe` interface), as all native projects will call `CC`/`CXX` with flags that are only compatible with `cl.exe`; - `-I` does not seem to set up the system headers correctly, for this `-imsvc` should be used; - `-fuse-ld=lld-link` does not strictly need to be set in `C(XX)FLAGS` unless a native project uses `CC`/`CXX` to link libraries (otherwise only `cargo`/`rustc` does this, but invokes it through the `LINKER` environment variable which is configured to `rust-lld`, as the default is otherwise `link.exe`).
- Loading branch information