wasm: update the build flag to reduce generated wasm file size
authorSubhransu Mohanty <sub.mohanty@samsung.com>
Tue, 21 Jul 2020 01:43:52 +0000 (10:43 +0900)
committerJongmin Lee <jm105.lee@samsung.com>
Tue, 28 Jul 2020 22:37:59 +0000 (07:37 +0900)
wasm_build.sh
wasm_cross.txt

index fe60eb1..61ffa6a 100755 (executable)
@@ -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.*
index 92fe0f0..eaf7e16 100644 (file)
@@ -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'