thorvg/wasm_build.sh
Shinwoo Kim 0c68c45ef7 thorvg viewer: introduce thorvg viewer
Support Emscripten wasm build for thorvg viewer
2020-10-13 19:04:46 +09:00

18 lines
574 B
Bash
Executable file

#!/bin/bash
if [ -z "$1" ]; then
echo "Emscripten SDK PATH is not provided"
echo "Usage: wasm_build EMSDK_PATH"
exit 1;
fi
if [ ! -d "./builddir_wasm" ]; then
sed "s|EMSDK:|$1|g" wasm_cross.txt > /tmp/.wasm_cross.txt
meson -Dbindings=[''] -Db_lto=true -Ddefault_library=static --cross-file /tmp/.wasm_cross.txt builddir_wasm
cp ./test/wasm_test.html builddir_wasm/src/index.html
fi
ninja -C builddir_wasm/
echo "RESULT:"
echo " thorvg-wasm.wasm and thorvg-wasm.js can be found in builddir_wasm/src folder"
ls -lrt builddir_wasm/src/thorvg-wasm.*