aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/build.bat
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-03-14 00:45:41 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2020-03-15 14:49:27 -0600
commit176e723408928426668730ad74bde3badad39ed2 (patch)
tree286b9400bc0f1f1b53cbbceee4029ac1dbd5d9f7 /build.bat
parentl18n: add go 1.14 generated output (diff)
downloadwireguard-windows-176e723408928426668730ad74bde3badad39ed2.tar.xz
wireguard-windows-176e723408928426668730ad74bde3badad39ed2.zip
l18n: add stub for cross platform
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'build.bat')
-rw-r--r--build.bat11
1 files changed, 6 insertions, 5 deletions
diff --git a/build.bat b/build.bat
index 12c9da27..a118c3d4 100644
--- a/build.bat
+++ b/build.bat
@@ -2,7 +2,7 @@
rem SPDX-License-Identifier: MIT
rem Copyright (C) 2019 WireGuard LLC. All Rights Reserved.
-setlocal
+setlocal enabledelayedexpansion
set BUILDDIR=%~dp0
set PATH=%BUILDDIR%.deps\go\bin;%BUILDDIR%.deps;%PATH%
set PATHEXT=.exe
@@ -34,6 +34,11 @@ if exist .deps\prepared goto :render
set GOOS=windows
set GOPATH=%BUILDDIR%.deps\gopath
set GOROOT=%BUILDDIR%.deps\go
+ if "%GoGenerate%"=="yes" (
+ echo [+] Regenerating files
+ set PATH=!BUILDDIR!.deps\x86_64-w64-mingw32-native\bin;!PATH!
+ go generate ./... || exit /b 1
+ )
set CGO_ENABLED=1
set CGO_CFLAGS=-O3 -Wall -Wno-unused-function -Wno-switch -std=gnu11 -DWINVER=0x0601
set CGO_LDFLAGS=-Wl,--dynamicbase -Wl,--nxcompat -Wl,--export-all-symbols
@@ -70,10 +75,6 @@ if exist .deps\prepared goto :render
mkdir %1 >NUL 2>&1
echo [+] Assembling resources %1
windres -i resources.rc -o resources.syso -O coff || exit /b %errorlevel%
- if "%GoGenerate%|%1"=="yes|x86" (
- echo [+] Regenerating files
- go generate ./... || exit /b 1
- )
echo [+] Building program %1
go build -ldflags="-H windowsgui -s -w" -tags walk_use_cgo -trimpath -v -o "%~1\wireguard.exe" || exit /b 1
if not exist "%~1\wg.exe" (