summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hinton <github@hinton.e4ward.com>2024-07-11 13:02:32 -0600
committerJack O'Connor <oconnor663@gmail.com>2024-07-12 09:34:19 -0700
commiteaf7eb97bfd50ff7ca43d5b78007da0f457e8565 (patch)
tree2de884cf0beaa2b05e0d41ac21f26566eb62fb10
parent8416b1658c2690dc6351bdc7e0975b0d5f1a5282 (diff)
Do not let cc-rs trigger a rebuild any time the env changes
-rw-r--r--build.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/build.rs b/build.rs
index 886ff95..af5805d 100644
--- a/build.rs
+++ b/build.rs
@@ -97,6 +97,11 @@ fn new_build() -> cc::Build {
if !is_windows_msvc() {
build.flag("-std=c11");
}
+ // Do NOT trigger a rebuild any time the env changes (e.g. $PATH).
+ // This prevents all downstream crates from being rebuilt when `cargo check`
+ // or `cargo build` are run in different environments, like Rust Analyzer
+ // vs. in the terminal vs. in a Git pre-commit hook.
+ build.emit_rerun_if_env_changed(false);
build
}