mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-21 22:12:05 +08:00
6adb63b915
date: 2026-06-04T09:49:56 master commit: c0ab3550eca2e9daf197c46b7e4b24aa9637cf2e
23 lines
652 B
Bash
Executable File
23 lines
652 B
Bash
Executable File
#!/usr/bin/env bash
|
|
cd "$(dirname "$0")"
|
|
|
|
# prereq: install emscripten: https://emscripten.org/docs/getting_started/downloads.html
|
|
EMSCRIPTEN_PATH=~/emsdk/emsdk_env.sh
|
|
source $EMSCRIPTEN_PATH
|
|
step="transformer"
|
|
initial_memory=6553600
|
|
max_memory=1500053504
|
|
exported_functions='["_net", "_malloc", "_free", "_set_buf"]'
|
|
|
|
emcc "${step}.c" \
|
|
-O3 -msimd128 -ffast-math -flto \
|
|
-o "${step}.js" \
|
|
-s MODULARIZE=1 \
|
|
-s EXPORT_ES6=1 \
|
|
-s EXPORTED_FUNCTIONS="${exported_functions}" \
|
|
-s ENVIRONMENT='worker' \
|
|
-s FILESYSTEM=0 \
|
|
-s EVAL_CTORS \
|
|
-s ALLOW_MEMORY_GROWTH=1 \
|
|
-s INITIAL_MEMORY="$initial_memory" \
|
|
-s MAXIMUM_MEMORY="$max_memory" |