Skip to content

Commit d1bd4fb

Browse files
author
Jonas Schievink
committed
Refuse to build nRF52+ HALs for thumbv6
1 parent 63697e5 commit d1bd4fb

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+
"the nRF HAL 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)