mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-12-22 16:11:38 +03:00
branch on linux/mac wasi-sdk (#37)
This commit is contained in:
parent
d1c607f388
commit
d8c10db602
@ -13,9 +13,20 @@ WASI_VERSION=20
|
||||
WASI_VERSION_FULL=${WASI_VERSION}.0
|
||||
CC_PATH=$(realpath ./wasi-sdk-${WASI_VERSION_FULL}/bin/clang)
|
||||
|
||||
# Determine operating system
|
||||
OS_TYPE="$(uname)"
|
||||
if [ "$OS_TYPE" = "Darwin" ]; then
|
||||
WASI_PLATFORM="macos"
|
||||
elif [ "$OS_TYPE" = "Linux" ]; then
|
||||
WASI_PLATFORM="linux"
|
||||
else
|
||||
echo "Unsupported OS: $OS_TYPE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -e "$CC_PATH" ]; then
|
||||
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz
|
||||
tar xvf wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz
|
||||
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/wasi-sdk-${WASI_VERSION_FULL}-${WASI_PLATFORM}.tar.gz
|
||||
tar xvf wasi-sdk-${WASI_VERSION_FULL}-${WASI_PLATFORM}.tar.gz
|
||||
fi
|
||||
|
||||
CC_PATH=$(realpath ./wasi-sdk-${WASI_VERSION_FULL}/bin/clang)
|
||||
@ -38,3 +49,4 @@ CARGO_TARGET_WASM32_WASI_LINKER = "$CC_PATH"
|
||||
EOF
|
||||
|
||||
RUSTFLAGS="-C target-feature=-crt-static -C link-arg=-Wl,--no-entry,--export=init,--export=cabi_realloc" cargo build --release --no-default-features --target wasm32-wasi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user