aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32f7/build.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2021-11-07 23:52:11 +0100
committerDario Nieuwenhuis <[email protected]>2021-11-07 23:52:11 +0100
commit2221e1fa935fef1fbc8a39a478824f0b163e6399 (patch)
treee411210300b63cf3bec2e32e2fb0f2d270129d84 /examples/stm32f7/build.rs
parent90095adedf370ddcda6d364dbb5e7f3a0a9b5895 (diff)
Replace rustflags with build.rs extra-link-args.
Rustflags apply to ALL the crates in the graph, while we only need them for the toplevel crate which is the only one getting linked. Rustflags are not equal for all crates, this caused cargo to re-build the same dependency crate multiple times uselessly. After this change, deps are reused more, making builds faster. Note that this only applies when sharing the target/ dir for multiple crates in the repo which is not the default.
Diffstat (limited to 'examples/stm32f7/build.rs')
-rw-r--r--examples/stm32f7/build.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/stm32f7/build.rs b/examples/stm32f7/build.rs
index b81f6b6e1..b72dd55ec 100644
--- a/examples/stm32f7/build.rs
+++ b/examples/stm32f7/build.rs
@@ -35,5 +35,9 @@ fn main() -> Result<(), Error> {
35 // Tell Cargo where to find the file. 35 // Tell Cargo where to find the file.
36 println!("cargo:rustc-link-search={}", out_dir.display()); 36 println!("cargo:rustc-link-search={}", out_dir.display());
37 37
38 println!("cargo:rustc-link-arg-bins=--nmagic");
39 println!("cargo:rustc-link-arg-bins=-Tlink.x");
40 println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
41
38 Ok(()) 42 Ok(())
39} 43}