Skip to content
This repository was archived by the owner on Nov 28, 2023. It is now read-only.

Commit 6dc6f3b

Browse files
committed
Rerun the build script if the bin/{}.a archive has changed
1 parent 274a6f5 commit 6dc6f3b

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

build.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,10 @@ fn main() {
1414
if target.starts_with("riscv") {
1515
let mut target = Target::from_target_str(&target);
1616
target.retain_extensions("imfdc");
17+
let archive = format!("bin/{}.a", target.to_string());
1718

18-
let target = target.to_string();
19-
20-
fs::copy(
21-
format!("bin/{}.a", target),
22-
out_dir.join(format!("lib{}.a", name)),
23-
)
24-
.unwrap();
25-
19+
fs::copy(&archive, out_dir.join(format!("lib{}.a", name))).unwrap();
20+
println!("cargo:rerun-if-changed={}", archive);
2621
println!("cargo:rustc-link-lib=static={}", name);
2722
}
2823

0 commit comments

Comments
 (0)