about summary refs log tree commit diff
path: root/compiler/rustc/build.rs
diff options
context:
space:
mode:
authorJoshua Nelson <jnelson@cloudflare.com>2022-07-10 23:57:25 -0500
committerJoshua Nelson <jnelson@cloudflare.com>2022-07-10 23:57:25 -0500
commit033a025b10f9b81579f28acfe4cce5f7db88ad74 (patch)
treedcbf9e7d5cb0f8dac19140ddc9ef72596c423515 /compiler/rustc/build.rs
parentc396bb3b8a16b1f2762b7c6078dc3e023f6a2493 (diff)
downloadrust-033a025b10f9b81579f28acfe4cce5f7db88ad74.tar.gz
rust-033a025b10f9b81579f28acfe4cce5f7db88ad74.zip
Don't rerun the build script for the compiler each time on linux
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.
Diffstat (limited to 'compiler/rustc/build.rs')
-rw-r--r--compiler/rustc/build.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc/build.rs b/compiler/rustc/build.rs
index 24c06c0ddbf..39cf3e094c8 100644
--- a/compiler/rustc/build.rs
+++ b/compiler/rustc/build.rs
@@ -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");
     }
 }