Skip to content

Commit

Permalink
Avoid reading env needlessly
Browse files Browse the repository at this point in the history
  • Loading branch information
tamird committed Nov 30, 2024
1 parent 806783c commit c5172de
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/integration-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,6 @@ fn main() {
let out_dir = env::var_os("OUT_DIR").unwrap();
let out_dir = PathBuf::from(out_dir);

let endian = env::var_os("CARGO_CFG_TARGET_ENDIAN").unwrap();
let target = if endian == "big" {
"bpfeb"
} else if endian == "little" {
"bpfel"
} else {
panic!("unsupported endian={:?}", endian)
};

const C_BPF: &[(&str, bool)] = &[
("ext.bpf.c", false),
("iter.bpf.c", true),
Expand All @@ -76,6 +67,15 @@ fn main() {
];

if build_integration_bpf {
let endian = env::var_os("CARGO_CFG_TARGET_ENDIAN").unwrap();
let target = if endian == "big" {
"bpfeb"
} else if endian == "little" {
"bpfel"
} else {
panic!("unsupported endian={:?}", endian)
};

let libbpf_dir = manifest_dir
.parent()
.unwrap()
Expand Down

0 comments on commit c5172de

Please sign in to comment.