diff options
Diffstat (limited to 'cortex-m-rt/build.rs')
-rw-r--r-- | cortex-m-rt/build.rs | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/cortex-m-rt/build.rs b/cortex-m-rt/build.rs index 96a8560..2b65cdf 100644 --- a/cortex-m-rt/build.rs +++ b/cortex-m-rt/build.rs @@ -1,4 +1,4 @@ -use std::fs::{self, File}; +use std::fs::File; use std::io::Write; use std::path::{Path, PathBuf}; use std::{env, ffi::OsStr}; @@ -16,15 +16,6 @@ fn main() { .map_or(target.clone(), |stem| stem.to_str().unwrap().to_string()); } - let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()); - - if target.starts_with("thumbv") { - let lib_path = format!("bin/{}.a", target); - fs::copy(&lib_path, out_dir.join("libcortex-m-rt.a")).unwrap(); - println!("cargo:rustc-link-lib=static=cortex-m-rt"); - println!("cargo:rerun-if-changed={}", lib_path); - } - // Put the linker script somewhere the linker can find it let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); let link_x = include_bytes!("link.x.in"); @@ -69,6 +60,10 @@ INCLUDE device.x"# 240 }; + if target.ends_with("-eabihf") { + println!("cargo:rustc-cfg=has_fpu"); + } + // checking the size of the interrupts portion of the vector table is sub-architecture dependent writeln!( f, |