diff options
author | 2017-12-23 10:00:00 +0100 | |
---|---|---|
committer | 2017-12-23 10:00:00 +0100 | |
commit | ed6aa6896e7e1bfcb39c867a105ded475f242129 (patch) | |
tree | f2a8a57fe9aed6743d6528f54ecf49046a5b4fd7 /cortex-m-rt/build.rs | |
parent | 00541bb67dce44021eef828dc039c0ae65057d22 (diff) | |
download | cortex-m-ed6aa6896e7e1bfcb39c867a105ded475f242129.tar.gz cortex-m-ed6aa6896e7e1bfcb39c867a105ded475f242129.tar.zst cortex-m-ed6aa6896e7e1bfcb39c867a105ded475f242129.zip |
provide a DEBUG_MONITOR exception on ARMv7-M
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"); + } +} |