Skip to content

Commit

Permalink
Rollup merge of rust-lang#99145 - jyn514:dont-rerun-build-script, r=w…
Browse files Browse the repository at this point in the history
…esleywiser

Don't rerun the build script for the compiler each time on non-windows platforms

In practice, this doesn't matter very much because the script takes ~no time to run.
But this makes `CARGO_LOG=info` easier to read, and theoretically saves a few milliseconds.
  • Loading branch information
matthiaskrgr authored Jul 11, 2022
2 parents b16819d + 033a025 commit 28428d5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/rustc/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ fn main() {
let target_env = env::var("CARGO_CFG_TARGET_ENV");
if Ok("windows") == target_os.as_deref() && Ok("msvc") == target_env.as_deref() {
set_windows_exe_options();
} else {
// Avoid rerunning the build script every time.
println!("cargo:rerun-if-changed=build.rs");
}
}

Expand Down

0 comments on commit 28428d5

Please sign in to comment.