#!/bin/sh
set -eu
# Compile the retained Lua frontend at -O0 within the1536MiB budget.
# Emulator/game code stays at -O2; optional plugin bindings are excluded by patch.
for arg do
 case "$arg" in
  *src/frontend/mame/luaengine*.cpp)
   exec /emsdk/upstream/emscripten/em++ "$@" -O0 -g0
   ;;
 esac
done
for arg do
 case "$arg" in
  *dreamlife.html)
   exec /emsdk/upstream/emscripten/em++ "$@" -sASSERTIONS=1
   ;;
 esac
done
exec /emsdk/upstream/emscripten/em++ "$@"
