build.rs 259 B

123456789
  1. use std::env;
  2. fn main() {
  3. if env::var("CARGO_CFG_BPF_TARGET_ARCH").is_err() {
  4. let arch = env::var("HOST").unwrap();
  5. let arch = arch.splitn(2, '-').next().unwrap();
  6. println!("cargo:rustc-cfg=bpf_target_arch=\"{}\"", arch);
  7. }
  8. }