mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-10-30 13:50:53 +00:00
30 lines
1.0 KiB
Rust
30 lines
1.0 KiB
Rust
use std::env;
|
|
|
|
fn main() {
|
|
let target = env::var("TARGET").unwrap();
|
|
|
|
if target.starts_with("thumbv6m-") {
|
|
println!("cargo:rustc-cfg=cortex_m");
|
|
println!("cargo:rustc-cfg=armv6m");
|
|
} else if target.starts_with("thumbv7m-") {
|
|
println!("cargo:rustc-cfg=cortex_m");
|
|
println!("cargo:rustc-cfg=armv7m");
|
|
} 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)
|
|
} else if target.starts_with("thumbv8m.base") {
|
|
println!("cargo:rustc-cfg=cortex_m");
|
|
println!("cargo:rustc-cfg=armv8m");
|
|
println!("cargo:rustc-cfg=armv8m_base");
|
|
} else if target.starts_with("thumbv8m.main") {
|
|
println!("cargo:rustc-cfg=cortex_m");
|
|
println!("cargo:rustc-cfg=armv8m");
|
|
println!("cargo:rustc-cfg=armv8m_main");
|
|
}
|
|
|
|
if target.ends_with("-eabihf") {
|
|
println!("cargo:rustc-cfg=has_fpu");
|
|
}
|
|
}
|