2
0

include.sh 443 B

1234567891011121314151617181920
  1. #!/usr/bin/env bash
  2. set -ex
  3. include="$(realpath "$1")"
  4. cbindgen="$(realpath cbindgen)"
  5. for config in src/header/*/cbindgen.toml
  6. do
  7. dir="$(dirname "$config")"
  8. name="$(basename "$dir")"
  9. if [ "${name:0:1}" != "_" ]
  10. then
  11. header="$include/${name/_//}.h"
  12. pushd "$dir"
  13. cargo run --release --manifest-path "$cbindgen/Cargo.toml" -- \
  14. -c cbindgen.toml -o "$header" mod.rs
  15. popd
  16. fi
  17. done