Skip to content

Commit 88d9b7e

Browse files
Rerun build script when archive changes
Fixes rust-embedded/cortex-m-rt#236
1 parent 008fd73 commit 88d9b7e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

cortex-m-rt/build.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@ fn main() {
1919
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
2020

2121
if target.starts_with("thumbv") {
22-
fs::copy(
23-
format!("bin/{}.a", target),
24-
out_dir.join("libcortex-m-rt.a"),
25-
)
26-
.unwrap();
22+
let lib_path = format!("bin/{}.a", target);
23+
fs::copy(&lib_path, out_dir.join("libcortex-m-rt.a")).unwrap();
2724
println!("cargo:rustc-link-lib=static=cortex-m-rt");
25+
println!("cargo:rerun-if-changed={}", lib_path);
2826
}
2927

3028
// Put the linker script somewhere the linker can find it

0 commit comments

Comments
 (0)