aboutsummaryrefslogtreecommitdiff
path: root/build.rs
diff options
context:
space:
mode:
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs24
1 files changed, 2 insertions, 22 deletions
diff --git a/build.rs b/build.rs
index 23ceeba..f81072b 100644
--- a/build.rs
+++ b/build.rs
@@ -1,33 +1,13 @@
-use std::path::PathBuf;
-use std::{env, fs};
+use std::env;
fn main() {
let target = env::var("TARGET").unwrap();
let host_triple = env::var("HOST").unwrap();
- let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
- let name = env::var("CARGO_PKG_NAME").unwrap();
if host_triple == target {
println!("cargo:rustc-cfg=native");
}
- if target.starts_with("thumb") {
- let suffix = if env::var_os("CARGO_FEATURE_LINKER_PLUGIN_LTO").is_some() {
- "-lto"
- } else {
- ""
- };
-
- fs::copy(
- format!("bin/{}{}.a", target, suffix),
- out_dir.join(format!("lib{}.a", name)),
- )
- .unwrap();
-
- println!("cargo:rustc-link-lib=static={}", name);
- println!("cargo:rustc-link-search={}", out_dir.display());
- }
-
if target.starts_with("thumbv6m-") {
println!("cargo:rustc-cfg=cortex_m");
println!("cargo:rustc-cfg=armv6m");
@@ -37,7 +17,7 @@ fn main() {
} else if target.starts_with("thumbv7em-") {
println!("cargo:rustc-cfg=cortex_m");
println!("cargo:rustc-cfg=armv7m");
- println!("cargo:rustc-cfg=armv7em"); // (not currently used)
+ println!("cargo:rustc-cfg=armv7em");
} else if target.starts_with("thumbv8m.base") {
println!("cargo:rustc-cfg=cortex_m");
println!("cargo:rustc-cfg=armv8m");