aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32h7
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-11-07 23:06:10 +0000
committerGitHub <[email protected]>2021-11-07 23:06:10 +0000
commitdb889da0446833ff219e652bd68c397af858b999 (patch)
tree75428e4bdd94198994680070e4c3b8062e0f6f3a /examples/stm32h7
parent5322e293bdfca7c02fce76eae7a851ac59f422e0 (diff)
parent2221e1fa935fef1fbc8a39a478824f0b163e6399 (diff)
Merge #473
473: Replace rustflags with build.rs extra-link-args. r=Dirbaio a=Dirbaio 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. Co-authored-by: Dario Nieuwenhuis <[email protected]>
Diffstat (limited to 'examples/stm32h7')
-rw-r--r--examples/stm32h7/.cargo/config5
-rw-r--r--examples/stm32h7/build.rs5
2 files changed, 5 insertions, 5 deletions
diff --git a/examples/stm32h7/.cargo/config b/examples/stm32h7/.cargo/config
index 6b6a9f506..4106112cd 100644
--- a/examples/stm32h7/.cargo/config
+++ b/examples/stm32h7/.cargo/config
@@ -1,10 +1,5 @@
1[target.thumbv7em-none-eabihf] 1[target.thumbv7em-none-eabihf]
2runner = 'probe-run --chip STM32H743ZITx' 2runner = 'probe-run --chip STM32H743ZITx'
3rustflags = [
4 # LLD (shipped with the Rust toolchain) is used as the default linker
5 "-C", "link-arg=-Tlink.x",
6 "-C", "link-arg=-Tdefmt.x",
7]
8 3
9[build] 4[build]
10target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU) 5target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU)
diff --git a/examples/stm32h7/build.rs b/examples/stm32h7/build.rs
new file mode 100644
index 000000000..8cd32d7ed
--- /dev/null
+++ b/examples/stm32h7/build.rs
@@ -0,0 +1,5 @@
1fn main() {
2 println!("cargo:rustc-link-arg-bins=--nmagic");
3 println!("cargo:rustc-link-arg-bins=-Tlink.x");
4 println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
5}