mirror of https://github.com/aya-rs/aya
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
597 B
Rust
22 lines
597 B
Rust
3 years ago
|
use std::env;
|
||
|
|
||
|
fn main() {
|
||
2 years ago
|
check_rust_version();
|
||
2 years ago
|
println!("cargo:rerun-if-env-changed=CARGO_CFG_BPF_TARGET_ARCH");
|
||
2 years ago
|
if let Ok(arch) = env::var("CARGO_CFG_BPF_TARGET_ARCH") {
|
||
2 years ago
|
println!("cargo:rustc-cfg=bpf_target_arch=\"{arch}\"");
|
||
2 years ago
|
} else {
|
||
3 years ago
|
let arch = env::var("HOST").unwrap();
|
||
|
let arch = arch.split_once('-').map_or(&*arch, |x| x.0);
|
||
2 years ago
|
println!("cargo:rustc-cfg=bpf_target_arch=\"{arch}\"");
|
||
3 years ago
|
}
|
||
|
}
|
||
2 years ago
|
|
||
|
#[rustversion::nightly]
|
||
|
fn check_rust_version() {
|
||
|
println!("cargo:rustc-cfg=unstable");
|
||
|
}
|
||
|
|
||
|
#[rustversion::not(nightly)]
|
||
|
fn check_rust_version() {}
|