nandi/vflutter_ffipublic Fork 0
4506a586d7400b00d732dcb97167be75ab41cab1
Commits
Clone
git clone https://git.rickub.com/nandi/vflutter_ffi.git
git clone ssh://git@rickub.com/nandi/vflutter_ffi.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Replace V with Nim 472eb49 · on 4506a586d7400b00d732dcb97167be75ab41cab1 · nandithebull · 8h ago
build.sh · 25 lines · 1.0 KBBash Blame HistoryRaw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env bash
# Host build + smoke test. CI entry point; not used by Flutter itself.
set -euo pipefail
cd "$(dirname "$0")/.."

nim_bin="${NIM:-nim}"
command -v "$nim_bin" >/dev/null || {
  echo "Nim compiler not on PATH (set NIM=/path/to/nim)"; exit 1; }

mkdir -p build

# --mm:arc, not the default ORC: this library hands raw pointers to Dart and
# frees them on request, so there are no cycles to collect and no reason to
# pay for a cycle detector. -d:danger drops runtime checks the C ABI cannot
# report anyway, and turns on the optimiser — without it the numeric kernels
# run several times slower.
#
# --threads:on because Dart calls in from many isolates, each its own OS
# thread; --noMain because the host program owns main(), not Nim.
"$nim_bin" c --app:lib --mm:arc -d:danger --threads:on --noMain \
  -o:build/libnimflutter.so src/nimflutter.nim

echo "built: $(stat -c%s build/libnimflutter.so) bytes"
nm -D --defined-only build/libnimflutter.so | grep ' nf_' || {
  echo "no nf_ exports!"; exit 1; }