2019-02-28 22:05:11 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2020-10-20 17:50:20 -07:00
|
|
|
if [[ "$#" -ne 1 ]]; then
|
2019-05-21 11:22:33 -07:00
|
|
|
echo "Error: Must provide the full path to the project to build"
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-10-20 17:50:20 -07:00
|
|
|
if [[ ! -f "$1/Cargo.toml" ]]; then
|
2019-05-21 11:22:33 -07:00
|
|
|
echo "Error: Cannot find project: $1"
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-10-20 17:50:20 -07:00
|
|
|
bpf_sdk=$(cd "$(dirname "$0")/.." && pwd)
|
2019-05-21 11:22:33 -07:00
|
|
|
|
2019-06-20 16:07:12 -07:00
|
|
|
echo "Building $1"
|
2019-02-28 22:05:11 -08:00
|
|
|
set -e
|
2020-10-20 17:50:20 -07:00
|
|
|
# shellcheck source=sdk/bpf/env.sh
|
|
|
|
source "$bpf_sdk"/env.sh
|
2019-06-20 16:49:33 -07:00
|
|
|
|
|
|
|
cd "$1"
|
2020-10-20 17:50:20 -07:00
|
|
|
"$XARGO" build --target "$XARGO_TARGET" --release --no-default-features --features program
|
2019-02-28 22:05:11 -08:00
|
|
|
|
2019-03-02 21:56:54 -08:00
|
|
|
{ { set +x; } 2>/dev/null; echo Success; }
|