diff options
| author | Giang Dao <dtrnggiang@gmail.com> | 2025-03-17 18:34:28 +0800 |
|---|---|---|
| committer | Giang Dao <dtrnggiang@gmail.com> | 2025-03-17 19:41:15 +0800 |
| commit | 55239b5d5a20cbed628e52b998ac11d2aa3376e3 (patch) | |
| tree | 9744ed7707420ff6c6099b653b9361facc4e556f /src | |
| parent | 43152ad47bb15e46c001820df854d4f65964e74a (diff) | |
adjust comment
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/src/core/build_steps/dist.rs | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs index 33155ab3795..a4a9cb7ef31 100644 --- a/src/bootstrap/src/core/build_steps/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs @@ -1966,8 +1966,6 @@ fn add_env( target: TargetSelection, built_tools: &HashSet<&'static str>, ) { - // envs for wix should be always defined, even if not used - // FIXME: is they affect ccache? let mut parts = builder.version.split('.'); cmd.env("CFG_RELEASE_INFO", builder.rust_version()) .env("CFG_RELEASE_NUM", &builder.version) @@ -1989,26 +1987,14 @@ fn add_env( cmd.env("CFG_MINGW", "0").env("CFG_ABI", "MSVC"); } - if built_tools.contains("rustfmt") { - cmd.env("CFG_RUSTFMT", "1"); - } else { - cmd.env("CFG_RUSTFMT", "0"); - } - if built_tools.contains("clippy") { - cmd.env("CFG_CLIPPY", "1"); - } else { - cmd.env("CFG_CLIPPY", "0"); - } - if built_tools.contains("miri") { - cmd.env("CFG_MIRI", "1"); - } else { - cmd.env("CFG_MIRI", "0"); - } - if built_tools.contains("rust-analyzer") { - cmd.env("CFG_RA", "1"); - } else { - cmd.env("CFG_RA", "0"); - } + // ensure these variables are defined + let mut define_optional_tool = |tool_name: &str, env_name: &str| { + cmd.env(env_name, if built_tools.contains(tool_name) { "1" } else { "0" }); + }; + define_optional_tool("rustfmt", "CFG_RUSTFMT"); + define_optional_tool("clippy", "CFG_CLIPPY"); + define_optional_tool("miri", "CFG_MIRI"); + define_optional_tool("rust-analyzer", "CFG_RA"); } fn install_llvm_file( |
