2018-04-11 17:27:11 +04:00
|
|
|
fn main() {
|
2019-03-27 14:35:08 +04:00
|
|
|
println!("cargo:rerun-if-env-changed=LOG");
|
2019-09-29 11:35:36 +04:00
|
|
|
println!("cargo:rerun-if-env-changed=SMP");
|
2019-03-27 14:35:08 +04:00
|
|
|
println!("cargo:rerun-if-env-changed=BOARD");
|
2019-06-15 20:03:32 +04:00
|
|
|
println!("cargo:rerun-if-env-changed=USER_IMG");
|
2018-11-28 21:22:44 +04:00
|
|
|
|
2020-06-16 12:16:45 +04:00
|
|
|
let _arch: String = std::env::var("ARCH").unwrap();
|
2019-08-30 14:20:58 +04:00
|
|
|
if let Ok(user_img) = std::env::var("USER_IMG") {
|
|
|
|
println!("cargo:rerun-if-changed={}", user_img);
|
|
|
|
}
|
2020-06-26 19:39:27 +04:00
|
|
|
|
|
|
|
// for shorter #[cfg] check
|
|
|
|
let target = std::env::var("TARGET").unwrap();
|
|
|
|
if target.contains("riscv32") {
|
|
|
|
println!("cargo:rustc-cfg=riscv");
|
|
|
|
println!("cargo:rustc-cfg=riscv32");
|
|
|
|
} else if target.contains("riscv64") {
|
|
|
|
println!("cargo:rustc-cfg=riscv");
|
|
|
|
println!("cargo:rustc-cfg=riscv64");
|
2020-07-07 06:00:24 +04:00
|
|
|
} else if target.contains("mipsel") {
|
|
|
|
println!("cargo:rustc-cfg=mipsel");
|
|
|
|
} else if target.contains("aarch64") {
|
|
|
|
println!("cargo:rustc-cfg=aarch64");
|
|
|
|
} else if target.contains("x86_64") {
|
|
|
|
println!("cargo:rustc-cfg=x86_64");
|
2020-06-26 19:39:27 +04:00
|
|
|
}
|
2020-06-16 13:09:44 +04:00
|
|
|
}
|