samples and html fix

This commit is contained in:
NikVolf
2017-04-12 16:03:06 +03:00
parent 08ac853719
commit a0f5f59bc0
3 changed files with 16 additions and 4 deletions
+10 -1
View File
@@ -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