cargo-build-sbf 436 B

12345678910111213141516
  1. #!/usr/bin/env bash
  2. here=$(dirname "$0")
  3. maybe_sbf_sdk="--sbf-sdk $here/platform-tools-sdk/sbf"
  4. for a in "$@"; do
  5. if [[ $a = --sbf-sdk ]]; then
  6. maybe_sbf_sdk=
  7. fi
  8. done
  9. set -ex
  10. if [[ ! -f "$here"/platform-tools-sdk/sbf/syscalls.txt ]]; then
  11. cargo build --manifest-path "$here"/syscalls/gen-syscall-list/Cargo.toml
  12. fi
  13. exec cargo run --manifest-path "$here"/platform-tools-sdk/cargo-build-sbf/Cargo.toml -- $maybe_sbf_sdk "$@"