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

WINOWS: Go Build is **really** slow #544

Closed ax4w closed 1 year ago

ax4w commented 1 year ago

When I build a small SDL2 program, it takes like 3-4 minutes to compile on windows 11. Meanwhile on my macOS install its almost instant

veeableful commented 1 year ago

Hi @0x3alex, thanks for submitting this issue! Was the Windows build the first time it was ever built and does it still take a long time on subsequent builds? If so, it sounds like go-sdl2 is being built each time your program is compiled, in which case may I know which version of Go you are using on Windows and how you are compiling your program?

ax4w commented 1 year ago

Hi, so it was for the first, let me guess, three to four builds. I added the -x flag and it seemed like, that it rebuild all of the SDL2 stuff...

I then restarted the CMD and now its as fast as on macOS...

Windows is weird :(

veeableful commented 1 year ago

Ahh okay, I was thinking that either the Go version is too old (<1.13) where you had to pre-build go-sdl2 if you didn't install go-sdl2 a certain way or the build command had a -a flag which always rebuilds everything.