Files
SunnyNet/BuildLibrary/MacOs_amd64.sh
2025-11-06 06:31:01 +08:00

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