diff options
Diffstat (limited to 'cortex-m-rt/build.rs')
-rw-r--r-- | cortex-m-rt/build.rs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/cortex-m-rt/build.rs b/cortex-m-rt/build.rs index 6494c13..1d0160c 100644 --- a/cortex-m-rt/build.rs +++ b/cortex-m-rt/build.rs @@ -4,7 +4,10 @@ use std::io::Write; use std::path::PathBuf; fn main() { - has_fpu(); + let target = env::var("TARGET").unwrap(); + + has_fpu(&target); + is_armv6m(&target); // Put the linker script somewhere the linker can find it let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); @@ -18,10 +21,14 @@ fn main() { println!("cargo:rerun-if-changed=link.x"); } -fn has_fpu() { - let target = env::var("TARGET").unwrap(); - +fn has_fpu(target: &str) { if target.ends_with("eabihf") { println!("cargo:rustc-cfg=has_fpu"); } } + +fn is_armv6m(target: &str) { + if target.starts_with("thumbv6m-") { + println!("cargo:rustc-cfg=armv6m"); + } +} |