Skip to content

Commit

Permalink
build-wasm32-wasi.sh: bump to wasi-sdk-23
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt committed Jul 26, 2024
1 parent f944682 commit 56773d2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions build-wasm32-wasi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e
# To build with wasi-threads enabled, not backed by pthread
# EXTRA_CMAKE_OPTIONS="-DTOYWASM_ENABLE_WASM_THREADS=ON -DTOYWASM_ENABLE_WASI_THREADS=ON -DTOYWASM_USE_USER_SCHED=ON" ./build-wasm32-wasi.sh

MAJOR=${WASI_SDK_MAJOR:-22}
MAJOR=${WASI_SDK_MAJOR:-23}
MINOR=${WASI_SDK_MINOR:-0}
WASI_SDK_DIR=${WASI_SDK_DIR:-$(pwd)/.wasi-sdk-${MAJOR}.${MINOR}}
CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE:-${WASI_SDK_DIR}/share/cmake/wasi-sdk.cmake}
Expand All @@ -20,6 +20,7 @@ mkdir -p ${DIST_DIR}

fetch_wasi_sdk()
{
MACHINE=$(uname -m)
UNAME=$(uname -s)
case ${UNAME} in
Darwin)
Expand All @@ -33,14 +34,14 @@ fetch_wasi_sdk()
exit 1
;;
esac
TAR=wasi-sdk-${MAJOR}.${MINOR}-${PLATFORM}.tar.gz
TAR=wasi-sdk-${MAJOR}.${MINOR}-${MACHINE}-${PLATFORM}.tar.gz
if [ ! -f ${DIST_DIR}/${TAR} ]; then
URL=https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${MAJOR}/${TAR}
curl -L -o ${DIST_DIR}/${TAR} ${URL}
fi
pax -rz \
-f ${DIST_DIR}/${TAR} \
-s"!^wasi-sdk-${MAJOR}\.${MINOR}!${WASI_SDK_DIR}!"
-s"!^wasi-sdk-${MAJOR}\.${MINOR}-${MACHINE}-${PLATFORM}!${WASI_SDK_DIR}!"
}

test -d "${WASI_SDK_DIR}" || fetch_wasi_sdk
Expand Down

0 comments on commit 56773d2

Please sign in to comment.