Add Chromium-only Blender WebEngine parity work
This commit is contained in:
28
tools/web/emscripten-env.sh
Executable file
28
tools/web/emscripten-env.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
WEB_EMSCRIPTEN_VERSION="3.1.69"
|
||||
web_workspace_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
|
||||
if command -v emcc >/dev/null 2>&1; then
|
||||
detected_version="$(emcc --version | awk '{for (i = 1; i <= NF; i++) if ($i ~ /^[0-9]+\.[0-9]+\.[0-9]+$/) {print $i; exit}}')"
|
||||
if [[ "${detected_version}" != "${WEB_EMSCRIPTEN_VERSION}" ]]; then
|
||||
echo "Expected Emscripten ${WEB_EMSCRIPTEN_VERSION}, found ${detected_version}" >&2
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "emcc was not found; install or activate emsdk ${WEB_EMSCRIPTEN_VERSION}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export WEB_EMSCRIPTEN_VERSION
|
||||
export EM_CONFIG="${web_workspace_root}/.emscripten-web"
|
||||
export EM_CACHE="${web_workspace_root}/.emcache"
|
||||
export WEB_EMSCRIPTEN_CFLAGS="-sENVIRONMENT=web,worker -sMODULARIZE=1 -sEXPORT_ES6=1"
|
||||
export WEB_EMSCRIPTEN_LDFLAGS="-sALLOW_MEMORY_GROWTH=1 -sFILESYSTEM=1"
|
||||
|
||||
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
||||
emcc --version | head -3
|
||||
node --version
|
||||
cmake --version | head -1
|
||||
fi
|
||||
Reference in New Issue
Block a user