mirror of
https://github.com/pezkuwichain/wasm-instrument.git
synced 2026-06-14 23:51:03 +00:00
samples and html fix
This commit is contained in:
+10
-1
@@ -3,4 +3,13 @@
|
||||
# "Compile rust source and put it as a tested contract"
|
||||
|
||||
mkdir -p out
|
||||
rustc $1 -o out/contract.js -O --target wasm32-unknown-emscripten
|
||||
|
||||
file=$1
|
||||
if [ ${file: -3} == ".rs" ]
|
||||
then
|
||||
# Rust is compiled with rustc
|
||||
rustc $file -o out/contract.js -O --target wasm32-unknown-emscripten
|
||||
else
|
||||
# c/c++ can be compiled directly by emcc
|
||||
emcc $file -Os -s WASM=1 -s SIDE_MODULE=1 -o out/contract.wasm
|
||||
fi
|
||||
Reference in New Issue
Block a user