2025-07-26

2025-07-26
This commit is contained in:
Qin tian
2025-07-26 16:00:33 +08:00
parent 1b59780d8c
commit 226a333e2c
41 changed files with 1113 additions and 547 deletions

19
BuildLibrary/Arm64.bat Normal file
View File

@@ -0,0 +1,19 @@
@echo off
set NDK=E:\init\windows-ndk-x86_64
set CGO_ENABLED=1
set tmpPath=%~dp0
cd %tmpPath:~0,1%:
for %%I in ("%tmpPath%..") do set "parentPath=%%~fI"
cd %parentPath%
set GOOS=android
set GOARCH=arm64
set CC=%NDK%\bin\aarch64-linux-android21-clang
echo [Full]_Build_Android_arm64-v8a.so
go build -ldflags "-s -w" -o "%tmpPath%Library/Full/Android/arm64-v8a/SunnyNet"
echo [Mini]_Build_Android_arm64-v8a.so
go build -tags mini -ldflags "-s -w" -o "%tmpPath%Library/Mini/Android/arm64-v8a/SunnyNet"
@echo on

View File

@@ -6,5 +6,5 @@ set tmpPath=%~dp0
cd %tmpPath:~0,1%:
for %%I in ("%tmpPath%..\") do set "parentPath=%%~fI"
cd %parentPath%
go build -buildmode=c-shared -ldflags "-s -w" -o "%tmpPath%Library\windows\x32\SunnyNet.dll"
go build -trimpath -buildmode=c-shared -ldflags "-s -w" -o "%tmpPath%Library\windows\x32\SunnyNet.dll"
@echo on

View File

@@ -13,40 +13,40 @@ cd %tmpPath:~0,1%:
for %%I in ("%tmpPath%..\") do set "parentPath=%%~fI"
cd %parentPath%
echo [Full]_Build_x86_DLL
go build -buildmode=c-shared -ldflags "-s -w" -o "%tmpPath%Library\Full\windows\SunnyNet.dll"
go build -trimpath -buildmode=c-shared -ldflags "-s -w" -o "%tmpPath%Library\Full\windows\SunnyNet.dll"
echo [Mini]_Build_x86_DLL
go build -tags mini -buildmode=c-shared -ldflags "-s -w" -o "%tmpPath%Library\Mini\windows\SunnyNet.dll"
go build -trimpath -tags mini -buildmode=c-shared -ldflags "-s -w" -o "%tmpPath%Library\Mini\windows\SunnyNet.dll"
set GOOS=windows
set GOARCH=amd64
echo [Full]_Build_x64_DLL
go build -buildmode=c-shared -ldflags "-s -w" -o "%tmpPath%Library\Full\windows\SunnyNet64.dll"
go build -trimpath -buildmode=c-shared -ldflags "-s -w" -o "%tmpPath%Library\Full\windows\SunnyNet64.dll"
echo [Mini]_Build_x64_DLL
go build -tags mini -buildmode=c-shared -ldflags "-s -w" -o "%tmpPath%Library\Mini\windows\SunnyNet64.dll"
go build -trimpath -tags mini -buildmode=c-shared -ldflags "-s -w" -o "%tmpPath%Library\Mini\windows\SunnyNet64.dll"
set GOOS=android
set GOARCH=arm
set CC=%NDK%\bin\armv7a-linux-androideabi21-clang
echo [Full]_Build_Android_armeabi-v7a.so
go build -buildmode=c-shared -ldflags "-s -w" -o "%tmpPath%Library/Full/Android/armeabi-v7a/libSunnyNet.so"
go build -trimpath -buildmode=c-shared -ldflags "-s -w" -o "%tmpPath%Library/Full/Android/armeabi-v7a/libSunnyNet.so"
echo [Mini]_Build_Android_armeabi-v7a.so
go build -tags mini -buildmode=c-shared -ldflags "-s -w" -o "%tmpPath%Library/Mini/Android/armeabi-v7a/libSunnyNet.so"
go build -trimpath -tags mini -buildmode=c-shared -ldflags "-s -w" -o "%tmpPath%Library/Mini/Android/armeabi-v7a/libSunnyNet.so"
set GOOS=android
set GOARCH=arm64
set CC=%NDK%\bin\aarch64-linux-android21-clang
echo [Full]_Build_Android_arm64-v8a.so
go build -buildmode=c-shared -ldflags "-s -w" -o "%tmpPath%Library/Full/Android/arm64-v8a/libSunnyNet.so"
go build -trimpath -buildmode=c-shared -ldflags "-s -w" -o "%tmpPath%Library/Full/Android/arm64-v8a/libSunnyNet.so"
echo [Mini]_Build_Android_arm64-v8a.so
go build -tags mini -buildmode=c-shared -ldflags "-s -w" -o "%tmpPath%Library/Mini/Android/arm64-v8a/libSunnyNet.so"
go build -trimpath -tags mini -buildmode=c-shared -ldflags "-s -w" -o "%tmpPath%Library/Mini/Android/arm64-v8a/libSunnyNet.so"
set GOOS=android
set GOARCH=386
set CC=%NDK%\bin\i686-linux-android16-clang
echo [Full]_Build_Android_x86.so
go build -buildmode=c-shared -ldflags "-s -w" -o "%tmpPath%Library/Full/Android/x86/libSunnyNet.so"
go build -trimpath -buildmode=c-shared -ldflags "-s -w" -o "%tmpPath%Library/Full/Android/x86/libSunnyNet.so"
echo [Mini]_Build_Android_x86.so
go build -tags mini -buildmode=c-shared -ldflags "-s -w" -o "%tmpPath%Library/Mini/Android/x86/libSunnyNet.so"
go build -trimpath -tags mini -buildmode=c-shared -ldflags "-s -w" -o "%tmpPath%Library/Mini/Android/x86/libSunnyNet.so"
@echo on

View File

@@ -10,7 +10,7 @@ tmpPath=$(dirname "$(readlink -f "$0")")
parentPath=$(dirname "$tmpPath")
cd "$parentPath"
go build -buildmode=c-shared -ldflags "-s -w" -o "$tmpPath/Library/Linux/x86/Sunny.so"
go build -trimpath -buildmode=c-shared -ldflags "-s -w" -o "$tmpPath/Library/Linux/x86/Sunny.so"
# 检查命令的退出状态码
if [ $? -ne 0 ]; then
echo ""

View File

@@ -10,7 +10,7 @@ tmpPath=$(dirname "$(readlink -f "$0")")
parentPath=$(dirname "$tmpPath")
cd "$parentPath"
go build -buildmode=c-shared -ldflags "-s -w" -o "$tmpPath/Library/Linux/amd64/Sunny.so"
go build -trimpath -buildmode=c-shared -ldflags "-s -w" -o "$tmpPath/Library/Linux/amd64/Sunny.so"
# 检查命令的退出状态码
if [ $? -ne 0 ]; then
echo ""