Skip to content

Commit df06e6e

Browse files
author
Tobias Kaupat
committed
Fix cargo build --all-targets
1 parent 423a82f commit df06e6e

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

README.md

-3
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ Cortex-M3 (ARMv7-M architecture):
4444
To see all errors use:
4545

4646
cargo build -vv
47-
48-
When building with `cargo build --all-targets` (like CLion does) the rustc compiler flags for linking
49-
are not passed and thus the build failes.
5047

5148
### Run Windows Demo
5249

build.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ fn main() {
1111
println!("cargo:rerun-if-changed=always");
1212

1313

14+
1415
// Build C Code
1516
cc::Build::new()
1617
.file("c-lib/add.c")
@@ -27,7 +28,7 @@ fn main() {
2728
let port = "MSVC-MingW";
2829

2930
// For GNU compilation we need the winmm library
30-
println!("cargo:rustc-flags=-lwinmm");
31+
println!("cargo:rustc-link-lib=static=winmm");
3132
cc::Build::new()
3233
//.cpp_link_stdlib("stdc++")
3334
//.flag("-DprojCOVERAGE_TEST=0")

0 commit comments

Comments
 (0)