Skip to content

Commit 845fa85

Browse files
Merge pull request #203 from jonas-schievink/no-thumbv6
Refuse to build nRF52+ HALs for thumbv6
2 parents 88bc4ca + ccc6a15 commit 845fa85

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

nrf-hal-common/build.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
use std::{env, process};
2+
3+
fn main() {
4+
if env::var_os("CARGO_FEATURE_51").is_none() {
5+
// Not building for the nRF51. 52+ use too many interrupts for the thumbv6 target, so detect
6+
// that early.
7+
if env::var("TARGET").unwrap() == "thumbv6m-none-eabi" {
8+
eprintln!(
9+
"this nRF device does not support the `thumbv6m-none-eabi` target; \
10+
build for `thumbv7em-none-eabi(hf)` instead"
11+
);
12+
process::exit(1);
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)