mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
Do not rebuild the build script unless necessary
Without this guard, the build script is rebuilt as soon as any file within the package is changed. This includes files created by external tools such as IDE.
This commit is contained in:
@@ -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:?}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user