aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas Schievink <jonasschievink@gmail.com> 2021-11-22 19:50:55 +0100
committerGravatar Jonas Schievink <jonasschievink@gmail.com> 2021-11-22 19:50:55 +0100
commit88d9b7e049f6508dc19c1ba715d1b085642d787c (patch)
tree56b0b02c3a6fcb21937b7b8701cf5e515d8abfb8
parent008fd73a1bb8e3d6f635b8aeeb96c57621e52c54 (diff)
downloadcortex-m-88d9b7e049f6508dc19c1ba715d1b085642d787c.tar.gz
cortex-m-88d9b7e049f6508dc19c1ba715d1b085642d787c.tar.zst
cortex-m-88d9b7e049f6508dc19c1ba715d1b085642d787c.zip
Rerun build script when archive changes
Fixes https://github.com/rust-embedded/cortex-m-rt/issues/236
-rw-r--r--cortex-m-rt/build.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/cortex-m-rt/build.rs b/cortex-m-rt/build.rs
index 6758d9e..96a8560 100644
--- a/cortex-m-rt/build.rs
+++ b/cortex-m-rt/build.rs
@@ -19,12 +19,10 @@ fn main() {
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
if target.starts_with("thumbv") {
- fs::copy(
- format!("bin/{}.a", target),
- out_dir.join("libcortex-m-rt.a"),
- )
- .unwrap();
+ let lib_path = format!("bin/{}.a", target);
+ fs::copy(&lib_path, out_dir.join("libcortex-m-rt.a")).unwrap();
println!("cargo:rustc-link-lib=static=cortex-m-rt");
+ println!("cargo:rerun-if-changed={}", lib_path);
}
// Put the linker script somewhere the linker can find it