fn main() {
let profile = std::env::var("PROFILE").unwrap_or_default();
let base_flags = "-O2 -mcpu=v4 -fno-stack-protector -fno-asynchronous-unwind-tables";
let cflags = if profile == "release" {
format!("{} -DCAKE_RELEASE=1", base_flags)
} else {
base_flags.to_string()
};
std::env::set_var("BPF_EXTRA_CFLAGS_PRE_INCL", &cflags);
scx_cargo::BpfBuilder::new()
.unwrap()
.enable_intf("src/bpf/intf.h", "bpf_intf.rs")
.enable_skel("src/bpf/cake.bpf.c", "bpf")
.add_source("../../../lib/arena.bpf.c")
.add_source("../../../lib/rbtree.bpf.c")
.add_source("../../../lib/atq.bpf.c")
.add_source("../../../lib/sdt_alloc.bpf.c")
.add_source("../../../lib/sdt_task.bpf.c")
.add_source("../../../lib/bitmap.bpf.c")
.add_source("../../../lib/cpumask.bpf.c")
.add_source("../../../lib/topology.bpf.c")
.compile_link_gen()
.unwrap();
}