aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/build.bat
diff options
context:
space:
mode:
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
commit439748fdeecad1e97307c2b0b154a6d1370b518c (patch)
tree2c825b68c237a877878ffbd626a822b63e2d8fac /build.bat
parentnames: better casing (diff)
downloadwireguard-windows-439748fdeecad1e97307c2b0b154a6d1370b518c.tar.xz
wireguard-windows-439748fdeecad1e97307c2b0b154a6d1370b518c.zip
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. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'build.bat')
-rw-r--r--build.bat5
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
set CGO_ENABLED=1
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
:installdeps