solana/cargo-build-sbf

17 lines
402 B
Plaintext
Raw Normal View History

2020-10-20 17:50:20 -07:00
#!/usr/bin/env bash
here=$(dirname "$0")
2020-11-04 18:29:26 -08:00
maybe_sbf_sdk="--sbf-sdk $here/sdk/sbf"
2020-11-04 18:29:26 -08:00
for a in "$@"; do
if [[ $a = --sbf-sdk ]]; then
maybe_sbf_sdk=
2020-11-04 18:29:26 -08:00
fi
done
set -ex
if [[ ! -f "$here"/sdk/sbf/syscalls.txt ]]; then
cargo build --manifest-path "$here"/programs/bpf_loader/gen-syscall-list/Cargo.toml
fi
exec cargo run --manifest-path "$here"/sdk/cargo-build-sbf/Cargo.toml -- $maybe_sbf_sdk "$@"