Update build

This commit is contained in:
Synthasmagoria 2026-09-02 00:05:57 +02:00
commit c9b770661a
3 changed files with 11 additions and 6 deletions

View file

@ -10,7 +10,7 @@ if [[ -v 1 ]]; then
if [ "$1" = "DEBUG" ]; then
ODIN_FLAGS="-debug"
elif [ "$1" = "RELEASE" ]; then
ODIN_FLAGS=""
ODIN_FLAGS="-o:size"
else
echo "Usage: <script> <DEBUG/RELEASE>"
exit 1
@ -42,7 +42,8 @@ files="$OUT_DIR/$WASM_OBJ_NAME $RAYLIB_PATH/wasm/libraylib.a $RAYLIB_PATH/wasm/l
# index_template.html contains the javascript code that calls the procedures in
# source/main_web/main_web.odin
flags="-O0 -sEXPORTED_RUNTIME_METHODS=['HEAPF32'] -sUSE_GLFW=3 -sWASM_BIGINT -sWARN_ON_UNDEFINED_SYMBOLS=0 --shell-file $INDEX_TEMPLATE_PATH --preload-file src/assets"
EMCC_SETTINGS="-sEXPORTED_RUNTIME_METHODS=['HEAPF32'] -sUSE_GLFW=3 -sWASM_BIGINT -sWARN_ON_UNDEFINED_SYMBOLS=0"
flags="-Wl,--gc-sections -Os $EMCC_SETTINGS --shell-file $INDEX_TEMPLATE_PATH --preload-file src/assets"
# For debugging: Add `-g` to `emcc` (gives better error callstack in chrome)
emcc -o $OUT_DIR/index.html $files $flags