mirror of
https://github.com/qtgolang/SunnyNet.git
synced 2026-08-30 22:11:29 -07:00
21 lines
448 B
Bash
21 lines
448 B
Bash
echo "" > /dev/null
|
|
echo "正在编译..."
|
|
set CGO_ENABLED=1
|
|
set GOOS=darwin
|
|
set GOARCH=amd64
|
|
tmpPath=$(dirname "$(readlink -f "$0")")
|
|
parentPath=$(dirname "$tmpPath")
|
|
cd "$parentPath"
|
|
|
|
go build -trimpath -buildmode=c-shared -ldflags "-s -w" -o "$tmpPath/Library/darwin/amd64/SunnyNet.dylib"
|
|
# 检查命令的退出状态码
|
|
if [ $? -ne 0 ]; then
|
|
echo ""
|
|
echo ""
|
|
echo "编译失败!"
|
|
else
|
|
echo ""
|
|
echo ""
|
|
echo "编译完成!"
|
|
fi
|