summaryrefslogtreecommitdiff
path: root/crossbuild.bash
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-06-06 21:10:24 +0200
committerJakob Unterwurzacher2021-06-06 21:10:24 +0200
commita08ef90811a23e0a1e700bcb44f21fae75b9ecff (patch)
tree681794034239c7ad38445fa35c3d886d869cc18b /crossbuild.bash
parente44d4fcb96cc437c7839cc997d44390c91328e8c (diff)
crossbuild.bash: skip Apple Silicon build on old Go versions
Diffstat (limited to 'crossbuild.bash')
-rwxr-xr-xcrossbuild.bash8
1 files changed, 6 insertions, 2 deletions
diff --git a/crossbuild.bash b/crossbuild.bash
index 2510bb0..0904d54 100755
--- a/crossbuild.bash
+++ b/crossbuild.bash
@@ -20,8 +20,12 @@ GOOS=linux GOARCH=arm64 $B
# MacOS on Intel
GOOS=darwin GOARCH=amd64 $B
-# MacOS on Apple Silicon M1
-GOOS=darwin GOARCH=arm64 $B
+# MacOS on Apple Silicon M1.
+# Go 1.16 added support for the M1 and added ios/arm64,
+# so we use this to check if we should attempt a build.
+if go tool dist list | grep ios/arm64 ; then
+ GOOS=darwin GOARCH=arm64 $B
+fi
# The cross-built binary is not useful on the compile host.
rm gocryptfs