| Initial commit: V -> Flutter FFI plugin ad0ccda nandi yesterday | 1 | #!/usr/bin/env bash |
| 2 | # Host build + smoke test. CI entry point; not used by Flutter itself. |
| 3 | set -euo pipefail |
| 4 | cd "$(dirname "$0")/.." |
| Replace V with Nim 472eb49 nandithebull 20h ago | 5 | |
| 6 | nim_bin="${NIM:-nim}" |
| 7 | command -v "$nim_bin" >/dev/null || { |
| 8 | echo "Nim compiler not on PATH (set NIM=/path/to/nim)"; exit 1; } |
| 9 | |
| Initial commit: V -> Flutter FFI plugin ad0ccda nandi yesterday | 10 | mkdir -p build |
| Replace V with Nim 472eb49 nandithebull 20h ago | 11 | |
| 12 | # --mm:arc, not the default ORC: this library hands raw pointers to Dart and |
| 13 | # frees them on request, so there are no cycles to collect and no reason to |
| 14 | # pay for a cycle detector. -d:danger drops runtime checks the C ABI cannot |
| 15 | # report anyway, and turns on the optimiser — without it the numeric kernels |
| 16 | # run several times slower. |
| 17 | # |
| 18 | # --threads:on because Dart calls in from many isolates, each its own OS |
| 19 | # thread; --noMain because the host program owns main(), not Nim. |
| 20 | "$nim_bin" c --app:lib --mm:arc -d:danger --threads:on --noMain \ |
| 21 | -o:build/libnimflutter.so src/nimflutter.nim |
| 22 | |
| 23 | echo "built: $(stat -c%s build/libnimflutter.so) bytes" |
| 24 | nm -D --defined-only build/libnimflutter.so | grep ' nf_' || { |
| 25 | echo "no nf_ exports!"; exit 1; } |