30:b02a3ab35cfe
Anton Shestakov <av6@dwimlabs.net>, Wed, 20 Jun 2018 17:56:57 +0800
recipe: adjust for newer Emscripten (1.38.6) 1.37.23 needs EXTRA_EXPORTED_RUNTIME_METHODS 1.38.1 emits WebAssembly by default and needs -s WASM=0 Let's stick to regular asm.js code and not wasm for now, just to support older/non-mainstream browsers.

previous change 29:df7b709d3bbc

recipe.sh

Permissions: -rw-r--r--

Other formats: Feeds:
#!/bin/sh
echo "Don't run this script directly, it's not ready for that yet."
echo "Instead, read through it and hand-pick statements that you need."
exit 1
# cd game-music-player
# mkdir build
# cd build
emcmake cmake ../
emmake make gme
(
printf '['
grep -P '(?<=Module\.)[a-zA-Z][a-zA-Z0-9_]+' -o player.js | sort -u | awk '{printf "\"" $0 "\", "}' | sed '$s/, $//'
echo ']'
) > runtime_methods.json
# Original, big and inclusive
emcc gme/libgme.so -o libgme.O0.js -O0 -s LINKABLE=1 -s EXPORT_ALL=1 -s EXTRA_EXPORTED_RUNTIME_METHODS=@runtime_methods.json -s WASM=0
(
echo '['
grep -E 'gme_[a-z0-9_]+' -o player.js | sort -u | awk '{printf " \"_" $0 "\",\n"}' | sed '$s/,$//'
echo ']'
) > exported_functions.json
# Smaller and hand-picked
emcc gme/libgme.so -o libgme.O2.js -O2 -s NO_FILESYSTEM=1 -s EXPORTED_FUNCTIONS=@exported_functions.json -s EXTRA_EXPORTED_RUNTIME_METHODS=@runtime_methods.json -s WASM=0
# Smaller still
emcc gme/libgme.so -o libgme.Oz.js -Oz --llvm-lto 1 -s NO_FILESYSTEM=1 -s EXPORTED_FUNCTIONS=@exported_functions.json -s EXTRA_EXPORTED_RUNTIME_METHODS=@runtime_methods.json -s WASM=0