forked from wasmerio/winterjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
12 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#! /bin/sh | ||
|
||
set -euo pipefail | ||
set -x | ||
|
||
# Note: cargo-wasix automatically runs wasm-opt with -O2, which makes the resulting binary unusable. | ||
# Instead, we use the toolchain to build (cargo +wasix instead of cargo wasix) and optimize manually. | ||
cargo +wasix build --target wasm32-wasmer-wasi | ||
mv target/wasm32-wasmer-wasi/debug/winterjs.wasm x.wasm | ||
wasm-opt x.wasm -o target/wasm32-wasmer-wasi/debug/winterjs.wasm -O1 --enable-bulk-memory --enable-threads --enable-reference-types --no-validation --asyncify | ||
rm x.wasm | ||
wasm-strip target/wasm32-wasmer-wasi/debug/winterjs.wasm |