From c3aeff4c6ec812579065eaaf59cd4b1a40df0c0f Mon Sep 17 00:00:00 2001 From: Subhransu Mohanty Date: Tue, 21 Jul 2020 10:43:52 +0900 Subject: [PATCH] wasm: update the build flag to reduce generated wasm file size --- wasm_build.sh | 4 ++-- wasm_cross.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wasm_build.sh b/wasm_build.sh index fe60eb1..61ffa6a 100755 --- a/wasm_build.sh +++ b/wasm_build.sh @@ -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.* diff --git a/wasm_cross.txt b/wasm_cross.txt index 92fe0f0..eaf7e16 100644 --- a/wasm_cross.txt +++ b/wasm_cross.txt @@ -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' -- 2.34.1