Last active
November 3, 2022 09:29
-
-
Save simonwo/476eaa9564a7ac99fa90c74a33beb3b1 to your computer and use it in GitHub Desktop.
Compile Rust to WASM with WASI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rustup.sh | |
sh rustup.sh -y | |
export PATH=~/.cargo/bin:$PATH | |
rustup target install wasm32-wasi | |
apt-get install -y build-essential libc6-dev clang-8 gcc-multilib | |
cd /code | |
CC_wasm32_wasi=clang-8 cargo build --target wasm32-wasi --release | |
cp target/wasm32-wasi/release/*.wasm /outputs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment