1
0
mirror of https://github.com/taigrr/wasm-experiments synced 2025-01-18 04:03:21 -08:00

Add adapted canvas demo for tinygo

This commit is contained in:
Johan Brandhorst
2019-06-23 15:08:02 +01:00
parent 53ba73a804
commit 54313e0f51
5 changed files with 540 additions and 7 deletions

View File

@@ -42,13 +42,17 @@ canvas: clean
cp $$(go env GOROOT)/misc/wasm/wasm_exec.js ./html/wasm_exec.js
tinygo-canvas: clean
docker run --rm -v $$(pwd):/go/src/github.com/johanbrandhorst/wasm-experiments tinygo/tinygo:0.6.1 /bin/bash -c "\
cd /go/src/github.com/johanbrandhorst/wasm-experiments && \
tinygo build -o ./html/test.wasm -target wasm --no-debug ./canvas/main.go && \
cp /usr/local/tinygo/targets/wasm_exec.js ./html/wasm_exec.js\
"
cp ./canvas/index.html ./html/index.html
cp ./canvas/main.go ./html/main.go
#docker run --rm -v $$(pwd):/go/src/github.com/johanbrandhorst/wasm-experiments tinygo/tinygo:0.6.1 /bin/bash -c "\
# cd /go/src/github.com/johanbrandhorst/wasm-experiments && \
# tinygo build -o ./html/test.wasm -target wasm --no-debug ./canvas/main.go && \
# cp /usr/local/tinygo/targets/wasm_exec.js ./html/wasm_exec.js\
#"
# Requires tinygo with experimental GC
# https://github.com/tinygo-org/tinygo/pull/350
tinygo build -o ./html/test.wasm -target wasm --no-debug ./tinygo-canvas/main.go
cp ~/go/src/github.com/tinygo-org/tinygo/targets/wasm_exec.js ./html/
cp ./tinygo-canvas/index.html ./html/index.html
cp ./tinygo-canvas/main.go ./html/main.go
.PHONY: ebiten
ebiten: clean