mirror of
https://github.com/pezkuwichain/wasm-instrument.git
synced 2026-06-20 20:21:01 +00:00
rename runner->js-runner
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
|
||||
# "Compile rust source and put it as a tested contract"
|
||||
|
||||
mkdir -p out
|
||||
|
||||
file=$1
|
||||
if [ ${file: -3} == ".rs" ]
|
||||
then
|
||||
# Rust is compiled with rustc
|
||||
rustc $file -o out/contract.js -O --target wasm32-unknown-emscripten -C linker=./linker_emcc.sh
|
||||
|
||||
# Gas injector
|
||||
cargo run --manifest-path=./../gas/Cargo.toml --release -- ./out/contract.wasm ./out/contract.wasm
|
||||
|
||||
# Allocator replacer
|
||||
cargo run --manifest-path=./../ext/Cargo.toml --release -- ./out/contract.wasm ./out/contract.wasm
|
||||
|
||||
# Symbols optimizer
|
||||
cargo run --manifest-path=./../opt/Cargo.toml --release -- ./out/contract.wasm ./out/contract.wasm
|
||||
|
||||
else
|
||||
# c/c++ can be compiled directly by emcc
|
||||
emcc $file -O3 -s WASM=1 -s SIDE_MODULE=1 -o out/contract.wasm
|
||||
|
||||
# Gas injector
|
||||
cargo run --manifest-path=./../gas/Cargo.toml --release -- ./out/contract.wasm ./out/contract.wasm
|
||||
|
||||
# Symbols optimizer
|
||||
cargo run --manifest-path=./../opt/Cargo.toml --release -- ./out/contract.wasm ./out/contract.wasm
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user