Skip to content

Commit

Permalink
Merge pull request uutils#6677 from samueltardieu/change-detection
Browse files Browse the repository at this point in the history
Do not rebuild the build script unless necessary
  • Loading branch information
sylvestre authored Sep 3, 2024
2 parents 2e0cd7b + 39765bf commit 1707b9d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ pub fn main() {
const FEATURE_PREFIX: &str = "feat_";
const OVERRIDE_PREFIX: &str = "uu_";

// Do not rebuild build script unless the script itself or the enabled features are modified
// See <https://doc.rust-lang.org/cargo/reference/build-scripts.html#change-detection>
println!("cargo:rerun-if-changed=build.rs");

if let Ok(profile) = env::var("PROFILE") {
println!("cargo:rustc-cfg=build={profile:?}");
}
Expand Down

0 comments on commit 1707b9d

Please sign in to comment.