ccd659e4e667f902da8ae4a2719b149d8f6ec38b
[platform/core/graphics/tizenvg.git] / wasm_build.sh
1 #!/bin/bash
2
3 if [ -z "$1" ]; then
4     echo "Emscripten SDK PATH is not provided"
5     echo "Usage: wasm_build EMSDK_PATH"
6     exit 1;
7 fi
8
9 if [ ! -d "./builddir_wasm" ]; then
10     sed "s|EMSDK:|$1|g" wasm_cross.txt > /tmp/.wasm_cross.txt
11     meson -Dbindings=[''] -Db_lto=true -Ddefault_library=static -Dlog=true --cross-file /tmp/.wasm_cross.txt builddir_wasm
12     cp ./test/wasm_test.html builddir_wasm/src/index.html
13 fi
14
15 ninja -C builddir_wasm/
16 echo "RESULT:"
17 echo " thorvg-wasm.wasm and thorvg-wasm.js can be found in builddir_wasm/src folder"
18 ls -lrt builddir_wasm/src/thorvg-wasm.*