Skip to content

Commit

Permalink
Support Apple M1 Mac (#823)
Browse files Browse the repository at this point in the history
See issue #822

Co-authored-by: apple <apple@abc.net>
  • Loading branch information
networkextension and apple committed Nov 26, 2020
1 parent 160b68c commit 76c4d23
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions build-release.sh
Expand Up @@ -67,6 +67,17 @@ tar -zcf kcptun-linux-arm$v-$VERSION.tar.gz client_linux_arm$v server_linux_arm$
$sum kcptun-linux-arm$v-$VERSION.tar.gz
done

#Apple M1 device
os=`uname` #Darwin
arch=`arch`
if [ $os == "Darwin" ] && [ $arch == "arm64" ]
then
env CGO_ENABLED=0 GOOS=darwin GOARCH=$arch go build -mod=vendor -ldflags "$LDFLAGS" -gcflags "$GCFLAGS" -o server_darwin_$arch github.com/xtaci/kcptun/server
env CGO_ENABLED=0 GOOS=darwin GOARCH=$arch go build -mod=vendor -ldflags "$LDFLAGS" -gcflags "$GCFLAGS" -o client_darwin_$arch github.com/xtaci/kcptun/client
tar -zcf kcptun-darwin-arm64-$VERSION.tar.gz client_darwin_arm64 server_darwin_arm64
$sum kcptun-darwin-arm64-$VERSION.tar.gz
fi

# ARM64
env CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -mod=vendor -ldflags "$LDFLAGS" -gcflags "$GCFLAGS" -o client_linux_arm64 github.com/xtaci/kcptun/client
env CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -mod=vendor -ldflags "$LDFLAGS" -gcflags "$GCFLAGS" -o server_linux_arm64 github.com/xtaci/kcptun/server
Expand Down

0 comments on commit 76c4d23

Please sign in to comment.