mirror of https://github.com/aya-rs/aya
commit
05e782abbf
@ -0,0 +1,12 @@
|
|||||||
|
# We have this so that one doesn't need to manually pass
|
||||||
|
# --target=bpfel-unknown-none -Z build-std=core when running cargo
|
||||||
|
# check/build/doc etc.
|
||||||
|
#
|
||||||
|
# NB: this file gets loaded only if you run cargo from this directory, it's
|
||||||
|
# ignored if you run from the workspace root. See
|
||||||
|
# https://doc.rust-lang.org/cargo/reference/config.html#hierarchical-structure
|
||||||
|
[build]
|
||||||
|
target = ["bpfeb-unknown-none", "bpfel-unknown-none"]
|
||||||
|
|
||||||
|
[unstable]
|
||||||
|
build-std = ["core"]
|
@ -0,0 +1,23 @@
|
|||||||
|
use std::{env, path::PathBuf};
|
||||||
|
|
||||||
|
use xtask::{create_symlink_to_binary, AYA_BUILD_INTEGRATION_BPF};
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
println!("cargo:rerun-if-env-changed={}", AYA_BUILD_INTEGRATION_BPF);
|
||||||
|
|
||||||
|
let build_integration_bpf = env::var(AYA_BUILD_INTEGRATION_BPF)
|
||||||
|
.as_deref()
|
||||||
|
.map(str::parse)
|
||||||
|
.map(Result::unwrap)
|
||||||
|
.unwrap_or_default();
|
||||||
|
|
||||||
|
if build_integration_bpf {
|
||||||
|
let out_dir = env::var_os("OUT_DIR").unwrap();
|
||||||
|
let out_dir = PathBuf::from(out_dir);
|
||||||
|
let bpf_linker_symlink = create_symlink_to_binary(&out_dir, "bpf-linker").unwrap();
|
||||||
|
println!(
|
||||||
|
"cargo:rerun-if-changed={}",
|
||||||
|
bpf_linker_symlink.to_str().unwrap()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
#![no_std]
|
||||||
|
|
||||||
|
// This file exists to enable the library target.
|
Loading…
Reference in New Issue