Skip to content

Commit

Permalink
Do not let cc-rs trigger a rebuild any time the env changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hintron authored and oconnor663 committed Jul 12, 2024
1 parent 8416b16 commit eaf7eb9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit eaf7eb9

Please sign in to comment.