Skip to content

Commit

Permalink
wasm: update the build flag to reduce generated wasm file size
Browse files Browse the repository at this point in the history
  • Loading branch information
smohantty committed Jul 21, 2020
1 parent a3ff1e9 commit ea0a3aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions wasm_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ fi

if [ ! -d "./builddir_wasm" ]; then
sed "s|EMSDK:|$1|g" wasm_cross.txt > /tmp/.wasm_cross.txt
meson -Dthread=false -Dmodule=false -Dcache=false -Dexample=false -Ddefault_library=static builddir_wasm --cross-file /tmp/.wasm_cross.txt
meson -Dthread=false -Dmodule=false -Dcache=false -Dexample=false -Db_lto=true -Ddefault_library=static builddir_wasm --cross-file /tmp/.wasm_cross.txt
cp ./test/wasm_test.html builddir_wasm/src/index.html
fi

sudo ninja -C builddir_wasm/
echo "RESULT:"
echo " rlottie-wasm.wasm and rlottie-wasm.js can be found in builddir_wasm/src folder"

ls -lrt builddir_wasm/src/rlottie-wasm.*
4 changes: 2 additions & 2 deletions wasm_cross.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ ar = 'EMSDK:upstream/emscripten/emar.py'

[properties]
root = 'EMSDK:upstream/emscripten/system'
cpp_args = ['--bind','-s', 'WASM=1', '-s', 'ALLOW_MEMORY_GROWTH=1', '-O2']
cpp_link_args = ['--bind','-s', 'WASM=1', '-s', 'ALLOW_MEMORY_GROWTH=1', '-O2']
cpp_args = ['--bind' , '-s' , 'WASM=1' , '-s' , 'ALLOW_MEMORY_GROWTH=1' , '-s' , 'FILESYSTEM=0' , '-O2']
cpp_link_args = ['--bind' , '-s' , 'WASM=1' , '-s' , 'ALLOW_MEMORY_GROWTH=1' , '-s' , 'FILESYSTEM=0' , '-O2']
shared_lib_suffix = 'js'
static_lib_suffix = 'js'
shared_module_suffix = 'js'
Expand Down

0 comments on commit ea0a3aa

Please sign in to comment.