support latest emscripten and detect emcc version changes

This commit is contained in:
Allen Ding 2024-11-20 12:23:02 -08:00
parent 627fd15e4d
commit b2df01fd18
7 changed files with 30 additions and 11 deletions

View file

@ -18,6 +18,16 @@ MODULE_FILE="$OUT_DIR/emscripten_compiled.js"
COMPILED_FILE="$OUT_DIR/emscripten_compiled.wasm"
WASM_FILE="$OUT_DIR/libcurl.wasm"
#check last used emscripten version
CURRENT_EMCC_VER="$(emcc --version)"
LAST_EMCC_VER="$(cat "$BUILD_DIR/emcc_version.txt" || emcc --version)"
if [ ! "$CURRENT_EMCC_VER" = "$LAST_EMCC_VER" ]; then
echo "triggering a full rebuild since we're on a different emcc version"
rm -rf "$BUILD_DIR"
mkdir -p "$BUILD_DIR"
fi
emcc --version > "$BUILD_DIR/emcc_version.txt"
#read exported functions
EXPORTED_FUNCS=""
for func in $(cat exported_funcs.txt); do