#!/usr/bin/env bash export _BUILD_MODE=${1:-debug}; export EMSDK_QUIET=1 export EMCC_CFLAGS="--no-entry -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s MAX_WEBGL_VERSION=2 -s MODULARIZE=1 -s EXPORT_NAME=createRustSkiaModule -s EXPORTED_RUNTIME_METHODS=GL -s ENVIRONMENT=web -s EXPORT_ES6=1 -sMODULARIZE" source /usr/local/emsdk/emsdk_env.sh; set -x _SCRIPT_DIR=$(dirname $0); _CARGO_PARAMS="--target=wasm32-unknown-emscripten"; if [ "$_BUILD_MODE" = "release" ]; then _CARGO_PARAMS="--release $_CARGO_PARAMS" fi pushd $_SCRIPT_DIR; cargo build $_CARGO_PARAMS cp target/wasm32-unknown-emscripten/$_BUILD_MODE/render_wasm.js ../frontend/resources/public/js/ cp target/wasm32-unknown-emscripten/$_BUILD_MODE/render_wasm.wasm ../frontend/resources/public/js/ popd