Add "cargo:rerun-if-changed=build.rs" to some build.rs files.

Add "cargo:rerun-if-changed=build.rs" in some build.rs files to tell
cargo that it doesn't need to scan the whole package. See the
[Cargo docs] for more info.

[Cargo docs]: https://doc.rust-lang.org/cargo/reference/build-scripts.html#rerun-if-changed
This commit is contained in:
Dan Gohman
2021-09-16 10:43:36 -07:00
parent faa117cac4
commit e56312e61a
2 changed files with 3 additions and 0 deletions

View File

@@ -3,4 +3,5 @@ fn main() {
"cargo:rustc-env=TARGET={}",
std::env::var("TARGET").unwrap()
);
println!("cargo:rerun-if-changed=build.rs");
}

View File

@@ -7,4 +7,6 @@ fn main() {
println!("cargo:wasi={}", wasi.display());
// and available to our own crate as WASI_ROOT:
println!("cargo:rustc-env=WASI_ROOT={}", wasi.display());
// and this build.rs script doesn't depend on any files.
println!("cargo:rerun-if-changed=build.rs");
}