27 lines
791 B
Bash
Executable File
27 lines
791 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
source "${repo_root}/tools/web/emscripten-env.sh"
|
|
|
|
build_dir="${repo_root}/build_web/toolchain-smoke"
|
|
mkdir -p "${build_dir}"
|
|
|
|
emcc "${repo_root}/web/engine/emscripten_smoke.c" \
|
|
-O2 \
|
|
${WEB_EMSCRIPTEN_CFLAGS} \
|
|
${WEB_EMSCRIPTEN_LDFLAGS} \
|
|
-o "${build_dir}/smoke.js"
|
|
|
|
emcc "${repo_root}/web/engine/emscripten_smoke.c" \
|
|
-O2 -pthread \
|
|
${WEB_EMSCRIPTEN_CFLAGS} \
|
|
${WEB_EMSCRIPTEN_LDFLAGS} \
|
|
-sPTHREAD_POOL_SIZE=1 \
|
|
-o "${build_dir}/smoke-pthread.js"
|
|
|
|
test -s "${build_dir}/smoke.wasm"
|
|
test -s "${build_dir}/smoke-pthread.wasm"
|
|
printf 'emscripten-toolchain-ok version=%s\n' "${WEB_EMSCRIPTEN_VERSION}"
|
|
sha256sum "${build_dir}/smoke.wasm" "${build_dir}/smoke-pthread.wasm"
|