veandco / go-sdl2

SDL2 binding for Go
https://godoc.org/github.com/veandco/go-sdl2
BSD 3-Clause "New" or "Revised" License
2.17k stars 219 forks source link

Getting an errror when compiling to wasm #584

Closed ThePuzzledDev closed 7 months ago

ThePuzzledDev commented 7 months ago

Go version: go version go1.21.4 linux/amd64 Go-SDL2 version: 0.4.36 SDL2 version: 2.28.5 OS: JS Architecture: WASM

When I attempt to compile to wasm I get the error: github.com/veandco/go-sdl2/img: build constraints exclude all Go files in /home/usr/.go/pkg/mod/github.com/veandco/go-sdl2@v0.4.36/img.

I'm using the command: env GOOS=js GOARCH=wasm go build -o wasm/game.wasm . I've also tried env GOOS=js GOARCH=wasm CC=gcc go build -o wasm/game.wasm . aswell as env GOOS=js GOARCH=wasm CGOENABLED=1 CC=gcc go build -o wasm/game.wasm .

veeableful commented 7 months ago

Hi @Debuholden, unfortunately we don't currently support WASM.

ThePuzzledDev commented 7 months ago

Ok, thanks for letting me know.