aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/build.bat
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2019-04-25 12:49:55 +0200
committerSimon Rozman <simon@rozman.si>2019-04-25 12:51:16 +0200
commit60f1e0f2e055bd7f9222bb77e8d5893333b76c43 (patch)
tree008b7e37fa2c4e91c7a96d7f44bef1d93b53c00d /build.bat
parentREADME: patch is no longer used (diff)
downloadwireguard-windows-60f1e0f2e055bd7f9222bb77e8d5893333b76c43.tar.xz
wireguard-windows-60f1e0f2e055bd7f9222bb77e8d5893333b76c43.zip
build: reduce excessive %PATH% manipulation
Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'build.bat')
-rw-r--r--build.bat13
1 files changed, 5 insertions, 8 deletions
diff --git a/build.bat b/build.bat
index fa2fda5d..51b32482 100644
--- a/build.bat
+++ b/build.bat
@@ -33,8 +33,8 @@ if exist .deps\prepared goto :build
set GOPATH=%STARTDIR%\.deps\gopath
set GOROOT=%STARTDIR%\.deps\go
set CGO_ENABLED=1
- call :build_plat x86 "%STARTDIR%\.deps\i686-w64-mingw32-native\bin" i686-w64-mingw32-gcc.exe 386 || goto :error
- call :build_plat amd64 "%STARTDIR%\.deps\x86_64-w64-mingw32-native\bin" x86_64-w64-mingw32-gcc.exe amd64 || goto :error
+ call :build_plat x86 i686 386 || goto :error
+ call :build_plat amd64 x86_64 amd64 || goto :error
:sign
if exist .\sign.bat call .\sign.bat
@@ -63,14 +63,11 @@ if exist .deps\prepared goto :build
goto :eof
:build_plat
- set OLDPATH2=%PATH%
- set PATH=%~2;%PATH%
- set CC=%~3
- set GOARCH=%~4
+ set CC=%STARTDIR%\.deps\%~2-w64-mingw32-native\bin\%~2-w64-mingw32-gcc.exe
+ set GOARCH=%~3
mkdir %1 >NUL 2>&1
echo [+] Assembling resources %1
- windres.exe -i resources.rc -o resources.syso -O coff || exit /b %errorlevel%
+ "%STARTDIR%\.deps\%~2-w64-mingw32-native\bin\windres.exe" -i resources.rc -o resources.syso -O coff || exit /b %errorlevel%
echo [+] Building program %1
go build -ldflags="-H windowsgui -s -w" -v -o "%~1\wireguard.exe" || exit /b %errorlevel%
- set PATH=%OLDPATH2%
goto :eof