diff options
author | 2021-11-22 19:50:55 +0100 | |
---|---|---|
committer | 2021-11-22 19:50:55 +0100 | |
commit | 88d9b7e049f6508dc19c1ba715d1b085642d787c (patch) | |
tree | 56b0b02c3a6fcb21937b7b8701cf5e515d8abfb8 | |
parent | 008fd73a1bb8e3d6f635b8aeeb96c57621e52c54 (diff) | |
download | cortex-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.rs | 8 |
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 |