Skip to content

Commit 0fa8f10

Browse files
committed
build: make arm64 binary by copying arm binary
Signed-off-by: Jason A. Donenfeld <[email protected]>
1 parent 1ed17fe commit 0fa8f10

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
/x86
77
/amd64
88
/arm
9+
/arm64
910

1011
# Misc
1112
/locales/*/out.gotext.json

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ RESOURCE_FILES := resources.rc version/version.go manifest.xml $(patsubst %.svg,
1515
DEPLOYMENT_HOST ?= winvm
1616
DEPLOYMENT_PATH ?= Desktop
1717

18-
all: amd64/wireguard.exe x86/wireguard.exe arm/wireguard.exe
18+
all: amd64/wireguard.exe x86/wireguard.exe arm64/wireguard.exe arm/wireguard.exe
1919

2020
define download =
2121
.distfiles/$(1):
@@ -66,6 +66,10 @@ arm/wireguard.exe: export GOARM := 7
6666
arm/wireguard.exe: resources_arm.syso $(SOURCE_FILES)
6767
go build $(GOFLAGS) -o $@
6868

69+
arm64/wireguard.exe: arm/wireguard.exe
70+
mkdir -p $(@D)
71+
cp $< $@
72+
6973
remaster: export GOARCH := amd64
7074
remaster: export GOPROXY := direct
7175
remaster: .deps/go/prepared
@@ -92,7 +96,7 @@ deploy: amd64/wireguard.exe
9296
scp $< $(DEPLOYMENT_HOST):$(DEPLOYMENT_PATH)
9397

9498
clean:
95-
rm -rf *.syso ui/icon/*.ico x86/ amd64/ arm/ .deps
99+
rm -rf *.syso ui/icon/*.ico x86/ amd64/ arm/ arm64/ .deps
96100

97101
distclean: clean
98102
rm -rf .distfiles

build.bat

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ if exist .deps\prepared goto :render
5252
call :build_plat x86 i686 386 || goto :error
5353
call :build_plat amd64 x86_64 amd64 || goto :error
5454
call :build_plat arm armv7 arm || goto :error
55+
call :build_plat arm64 aarch64 arm64 || goto :error
5556

5657
:sign
5758
if exist .\sign.bat call .\sign.bat
@@ -81,7 +82,11 @@ if exist .deps\prepared goto :render
8182
echo [+] Assembling resources %1
8283
%~2-w64-mingw32-windres -I ".deps\wintun\bin\%~1" -DWIREGUARD_VERSION_ARRAY=%WIREGUARD_VERSION_ARRAY% -DWIREGUARD_VERSION_STR=%WIREGUARD_VERSION% -i resources.rc -o "resources_%~3.syso" -O coff -c 65001 || exit /b %errorlevel%
8384
echo [+] Building program %1
84-
go build -ldflags="-H windowsgui -s -w" -trimpath -v -o "%~1\wireguard.exe" || exit /b 1
85+
if %1==arm64 (
86+
copy "arm\wireguard.exe" "%~1\wireguard.exe" || exit /b 1
87+
) else (
88+
go build -ldflags="-H windowsgui -s -w" -trimpath -v -o "%~1\wireguard.exe" || exit /b 1
89+
)
8590
if not exist "%~1\wg.exe" (
8691
echo [+] Building command line tools %1
8792
del .deps\src\*.exe .deps\src\*.o .deps\src\wincompat\*.o 2> NUL

0 commit comments

Comments
 (0)