path: root/build.bat
diff options
authorJason A. Donenfeld <Jason@zx2c4.com>2019-03-07 06:27:53 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-03-07 20:55:12 +0100
commit9c9c8d13bbc9b58de02271d4690cb20840c1d7c2 (patch)
tree2c825b68c237a877878ffbd626a822b63e2d8fac /build.bat
parentnames: better casing (diff)
ui: embed resource the old fashioned way
If we ever get rid of the cgo requirement, we can return to rsrc or some variant of it. But given that win32 GUI stuff benefits from the larger cgo stacks, that seems unlikely. This gives us a bit more latitude to embed all sorts of interesting things in here as well. Clean up the makefile while we're at it and reduce the size of the exe.
Diffstat (limited to 'build.bat')
1 files changed, 3 insertions, 2 deletions
diff --git a/build.bat b/build.bat
index 2d2224dd..0c8f1831 100644
--- a/build.bat
+++ b/build.bat
@@ -4,15 +4,16 @@ set OLDPATH=%PATH%
if not exist deps\.prepared call :installdeps
set PATH=%STARTDIR%\deps\x86_64-w64-mingw32-native\bin\;%STARTDIR%\deps\go\bin\;%PATH%
set CC=x86_64-w64-mingw32-gcc.exe
+set CFLAGS=-O3 -Wall -std=gnu11
set GOOS=windows
set GOARCH=amd64
set GOPATH=%STARTDIR%\deps\gopath
set GOROOT=%STARTDIR%\deps\go
echo Assembling resources
-go run github.com/akavel/rsrc -manifest ui/manifest.xml -ico ui/icon/icon.ico -arch amd64 -o resources.syso || goto :error
+windres.exe -i resources.rc -o resources.syso -O coff || goto :error
echo Building program
-go build -ldflags="-H windowsgui" -o wireguard.exe || goto :error
+go build -ldflags="-H windowsgui -s -w" -v -o wireguard.exe || goto :error
goto :out