wasm: add gl option to combined binary

This commit is contained in:
Jinny You 2024-12-02 13:30:32 +09:00 committed by Hermet Park
parent f33b63abad
commit 7b9c58fec3
2 changed files with 23 additions and 2 deletions

21
cross/wasm32.txt Normal file
View file

@ -0,0 +1,21 @@
[binaries]
cpp = 'EMSDK:upstream/emscripten/em++.py'
ar = 'EMSDK:upstream/emscripten/emar.py'
strip = '-strip'
[properties]
root = 'EMSDK:upstream/emscripten/system'
shared_lib_suffix = 'js'
static_lib_suffix = 'js'
shared_module_suffix = 'js'
exe_suffix = 'js'
[built-in options]
cpp_args = ['-Wshift-negative-value', '-flto', '-Os', '-fno-exceptions']
cpp_link_args = ['-Wshift-negative-value', '-flto', '-Os', '-fno-exceptions', '--bind', '-sWASM=1', '-sALLOW_MEMORY_GROWTH=1', '-sEXPORT_ES6=1', '-sFORCE_FILESYSTEM=1', '-sMODULARIZE=1', '-sEXPORTED_RUNTIME_METHODS=FS', '-sUSE_WEBGPU=1', '-sASYNCIFY=1', '-sSTACK_SIZE=4MB', '-sMAX_WEBGL_VERSION=2', '-sFULL_ES3']
[host_machine]
system = 'emscripten'
cpu_family = 'wasm32'
cpu = 'wasm32'
endian = 'little'

View file

@ -21,8 +21,8 @@ if [ ! -d "./build_wasm" ]; then
sed "s|EMSDK:|$EMSDK|g" ./cross/wasm32_gl.txt > /tmp/.wasm_cross.txt
meson -Db_lto=true -Ddefault_library=static -Dstatic=true -Dloaders="all" -Dsavers="all" -Dthreads=false -Dbindings="wasm_beta" -Dengines="gl" --cross-file /tmp/.wasm_cross.txt build_wasm
else
sed "s|EMSDK:|$EMSDK|g" ./cross/wasm32_wg.txt > /tmp/.wasm_cross.txt
meson -Db_lto=true -Ddefault_library=static -Dstatic=true -Dloaders="all" -Dsavers="all" -Dthreads=false -Dbindings="wasm_beta" -Dengines="wg, sw" --cross-file /tmp/.wasm_cross.txt build_wasm
sed "s|EMSDK:|$EMSDK|g" ./cross/wasm32.txt > /tmp/.wasm_cross.txt
meson -Db_lto=true -Ddefault_library=static -Dstatic=true -Dloaders="all" -Dsavers="all" -Dthreads=false -Dbindings="wasm_beta" -Dengines="wg, gl, sw" --cross-file /tmp/.wasm_cross.txt build_wasm
fi
fi