Skip to content

NMake Makefiles: Default to using the default Rust toolchain

Chun-wei Fan requested to merge msvc-default-rust into main

Hi,

This update the NMake Makefiles in the following ways:

  • Make it honor the default Rust toolchain that is set via rustup default xxx, rather than using the stable toolchain for the target arch. This is to make things easier for people who set the default Rust toolchain via rustup default xxx. This means one can just install, for instance a x86_64-pc-windows-msvc toolchain and add the i686-pc-windows-msvc and/or aarch64-pc-windows-msvc targets to it to build 32-bit and ARM64 builds with a single installed toolchain (which is set to be the default toolchain) instead of installing multiple toolchains, depending on which Visual Studio build commandline environment is used.
  • If no TOOLCHAIN_VERSION is specified, the NMake build will check whether the default toolchain being used is one that works for Visual Studio builds.
  • Drop the USE_NIGHTLY_TOOLCHAIN as one needs to be more specific about the nightly version being used, so just fold things into the TOOLCHAIN_VERSION option. The TOOLCHAIN_VERSION option continues to work as it did previously.
  • The build process is otherwise no different to the user, except that builds done in environments where a 64-bit compiler is used to build 32-bit binaries are now considered as a cross-build (a cmd.exe window pops up) when building the Rust bits.

With blessings, thank you!

Merge request reports