thorvg/wasm_build.sh
Hermet Park cfb6a7e913 common: STM32 portability enhancement
Some systems such as micro-processor might not support
the thread feature on the system.

Enhance the portability by compiling the thorvg with toggling the
threading depepdency through the build option.

For this, thorvg newly introduced the internal Key/ScopedLock abstraction
for transparent thread-locking dependnecy.

To turn off the thread feature, please use the next build option:

$meson setup build -Dthreads=false ...

Note that, the thread feature is enabled in default.
Turning off the thread feature could reduce the binary size by 7kb.

issue: https://github.com/thorvg/thorvg/issues/1900
2024-01-18 23:56:29 +09:00

11 lines
444 B
Bash
Executable file

#!/bin/bash
#https://github.com/thorvg/thorvg/wiki/ThorVG-Viewer-Development-Guide
if [ ! -d "./build_wasm" ]; then
sed "s|EMSDK:|$1|g" ./cross/wasm_x86_i686.txt > /tmp/.wasm_cross.txt
meson -Db_lto=true -Ddefault_library=static -Dstatic=true -Dloaders="all" -Dsavers="all" -Dthreads=false -Dbindings="wasm_beta" --cross-file /tmp/.wasm_cross.txt build_wasm
fi
ninja -C build_wasm/
ls -lrt build_wasm/src/bindings/wasm/thorvg-wasm.*