Files
solana/sdk/bpf/rust/build.sh
mergify[bot] e0ae54fd7e Add cargo-build-bpf (bp #13040) (#13075)
* Add cargo-build-bpf

(cherry picked from commit 07a853d6cc)

* Remove do.sh

(cherry picked from commit 61be155413)

Co-authored-by: Michael Vines <mvines@gmail.com>
2020-10-22 03:09:52 +00:00

22 lines
497 B
Bash
Executable File

#!/usr/bin/env bash
if [[ "$#" -ne 1 ]]; then
echo "Error: Must provide the full path to the project to build"
exit 1
fi
if [[ ! -f "$1/Cargo.toml" ]]; then
echo "Error: Cannot find project: $1"
exit 1
fi
bpf_sdk=$(cd "$(dirname "$0")/.." && pwd)
echo "Building $1"
set -e
# shellcheck source=sdk/bpf/env.sh
source "$bpf_sdk"/env.sh
cd "$1"
"$XARGO" build --target "$XARGO_TARGET" --release --no-default-features --features program
{ { set +x; } 2>/dev/null; echo Success; }