commit ac4f0215b51907f25f1a2d22e5e3f3c380ecad96
| author | 斟酌 鵬兄 <tgckpg@gmail.com> |
| date | 2026-05-31T18:50:42Z |
| subject | Windows needs dlls |
commit ac4f0215b51907f25f1a2d22e5e3f3c380ecad96
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date: 2026-05-31T18:50:42Z
Windows needs dlls
---
.github/workflows/cmake-multi-platform.yml | 37 ++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml
index 8022b50..1345093 100644
--- a/.github/workflows/cmake-multi-platform.yml
+++ b/.github/workflows/cmake-multi-platform.yml
@@ -282,6 +282,8 @@ jobs:
- name: Package artifact
shell: msys2 {0}
run: |
+ set -eu
+
mkdir -p dist/tinyproxy
if [ -f bin/tinyproxy.exe ]; then
@@ -290,6 +292,41 @@ jobs:
cp bin/tinyproxy dist/tinyproxy/tinyproxy.exe
fi
+ copy_deps() {
+ local file="$1"
+
+ ldd "$file" |
+ awk '
+ /=>/ {
+ dll = $3
+ if (dll ~ /^\/ucrt64\/bin\//) {
+ print dll
+ }
+ }
+ /^[[:space:]]*\/ucrt64\/bin\// {
+ print $1
+ }
+ ' |
+ sort -u |
+ while read -r dll; do
+ base="$(basename "$dll")"
+
+ if [ ! -f "dist/tinyproxy/$base" ]; then
+ echo "Copying DLL: $dll"
+ cp "$dll" dist/tinyproxy/
+ copy_deps "dist/tinyproxy/$base"
+ fi
+ done
+ }
+
+ echo "Runtime DLL dependencies:"
+ ldd dist/tinyproxy/tinyproxy.exe || true
+
+ copy_deps dist/tinyproxy/tinyproxy.exe
+
+ echo "Packaged files:"
+ find dist/tinyproxy -maxdepth 1 -type f -printf '%f\n' | sort
+
powershell.exe -NoProfile -Command \
"Compress-Archive -Path dist/tinyproxy -DestinationPath tinyproxy-windows-x64.zip -Force"