ci: add Windows on ARM64 cross-compilation and packaging jobs
- Add `build-windows-arm64` and `package-windows-arm64` stages to `.gitlab-ci.yml` and wire download links to wiki updates - Create `scripts/mingw-w64-arm64-toolchain.cmake` targeting `Windows` / `aarch64` with LLVM-MinGW - Update `docker/Dockerfile.build` with LLVM-MinGW toolchain, MSYS2 Qt 6.10 ARM64 packages, and ARM64 cross-compiled static libraries (libiconv, uchardet, zlib, minizip, libarchive) - Isolate GCC x86_64 and LLVM-MinGW ARM64 toolchains in `scripts/mingw-w64-toolchain.cmake` and PATH configuration - Refactor `packaging/package-windows.sh` to package both x86_64 and ARM64 runtime DLLs and support MSYS2 plugin/QML directory layouts - Update `scripts/test-ci-windows.sh` with `--arm64`, `--only-arm64`, `--image`, and local image detection - Guard `-mwindows` link flag with `if(MINGW)` in `CMakeLists.txt` - Document Windows ARM64 build targets and instructions in `AGENTS.md` and `README.md`
This commit is contained in:
9 files changed
+337
-72
No files matched your search
@@ -1,12 +1,13 @@
|
||||
#!/bin/bash
|
||||
# Package Windows build as a portable directory with all DLLs
|
||||
# Usage: package-windows.sh <build-dir> <qt-dir> <mingw-sysroot> <output-dir>
|
||||
# Usage: package-windows.sh <build-dir> <qt-dir> <mingw-sysroot> <output-dir> [arch]
|
||||
set -euo pipefail
|
||||
|
||||
BUILD_DIR="${1:?Usage: package-windows.sh <build-dir> <qt-dir> <mingw-sysroot> <output-dir>}"
|
||||
BUILD_DIR="${1:?Usage: package-windows.sh <build-dir> <qt-dir> <mingw-sysroot> <output-dir> [arch]}"
|
||||
QT_DIR="${2:?}"
|
||||
MINGW_SYSROOT="${3:?}"
|
||||
OUTPUT_DIR="${4:?}"
|
||||
ARCH="${5:-x86_64}"
|
||||
PROJECT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
|
||||
DIST_DIR="${BUILD_DIR}/dist"
|
||||
@@ -21,45 +22,79 @@ cp "$BUILD_DIR/asteria-qt.exe" "$DIST_DIR/"
|
||||
# windeployqt6 from the cross-compiled Qt may not work on Linux host,
|
||||
# so we manually copy the required DLLs
|
||||
|
||||
# Qt DLLs — copy all Qt6*.dll to avoid missing transitive dependencies
|
||||
cp "$QT_DIR/bin/"Qt6*.dll "$DIST_DIR/" 2>/dev/null || true
|
||||
# Qt DLLs — copy all Qt6*.dll and related runtime DLLs from Qt bin directory
|
||||
cp "$QT_DIR/bin/"*.dll "$DIST_DIR/" 2>/dev/null || true
|
||||
|
||||
# Qt plugins (support standard Qt layout and MSYS2 share/qt6 layout)
|
||||
PLUGIN_DIR="$QT_DIR/plugins"
|
||||
if [ ! -d "$PLUGIN_DIR" ] && [ -d "$QT_DIR/share/qt6/plugins" ]; then
|
||||
PLUGIN_DIR="$QT_DIR/share/qt6/plugins"
|
||||
fi
|
||||
|
||||
# Qt plugins
|
||||
mkdir -p "$DIST_DIR/platforms"
|
||||
cp "$QT_DIR/plugins/platforms/qwindows.dll" "$DIST_DIR/platforms/" 2>/dev/null || true
|
||||
cp "$PLUGIN_DIR/platforms/qwindows.dll" "$DIST_DIR/platforms/" 2>/dev/null || true
|
||||
|
||||
mkdir -p "$DIST_DIR/imageformats"
|
||||
cp "$QT_DIR/plugins/imageformats/"*.dll "$DIST_DIR/imageformats/" 2>/dev/null || true
|
||||
cp "$PLUGIN_DIR/imageformats/"*.dll "$DIST_DIR/imageformats/" 2>/dev/null || true
|
||||
|
||||
mkdir -p "$DIST_DIR/iconengines"
|
||||
cp "$QT_DIR/plugins/iconengines/"*.dll "$DIST_DIR/iconengines/" 2>/dev/null || true
|
||||
cp "$PLUGIN_DIR/iconengines/"*.dll "$DIST_DIR/iconengines/" 2>/dev/null || true
|
||||
|
||||
mkdir -p "$DIST_DIR/tls"
|
||||
cp "$QT_DIR/plugins/tls/"*.dll "$DIST_DIR/tls/" 2>/dev/null || true
|
||||
cp "$PLUGIN_DIR/tls/"*.dll "$DIST_DIR/tls/" 2>/dev/null || true
|
||||
|
||||
if [ -d "$PLUGIN_DIR/styles" ]; then
|
||||
mkdir -p "$DIST_DIR/styles"
|
||||
cp "$PLUGIN_DIR/styles/"*.dll "$DIST_DIR/styles/" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# QML modules (support standard Qt layout and MSYS2 share/qt6 layout)
|
||||
QML_DIR="$QT_DIR/qml"
|
||||
if [ ! -d "$QML_DIR" ] && [ -d "$QT_DIR/share/qt6/qml" ]; then
|
||||
QML_DIR="$QT_DIR/share/qt6/qml"
|
||||
fi
|
||||
|
||||
# QML modules
|
||||
mkdir -p "$DIST_DIR/qml"
|
||||
for mod in QtQuick QtQml Qt5Compat; do
|
||||
if [ -d "$QT_DIR/qml/$mod" ]; then
|
||||
cp -r "$QT_DIR/qml/$mod" "$DIST_DIR/qml/"
|
||||
for mod in QtCore Qt QtQuick QtQml Qt5Compat; do
|
||||
if [ -d "$QML_DIR/$mod" ]; then
|
||||
cp -r "$QML_DIR/$mod" "$DIST_DIR/qml/"
|
||||
fi
|
||||
done
|
||||
|
||||
# MinGW runtime DLLs
|
||||
MINGW_DLLS=(
|
||||
libgcc_s_seh-1.dll
|
||||
libstdc++-6.dll
|
||||
libwinpthread-1.dll
|
||||
)
|
||||
# Architecture-specific runtime DLLs
|
||||
if [ "$ARCH" = "arm64" ] || [ "$ARCH" = "aarch64" ]; then
|
||||
PKG_NAME="asteria-qt-windows-arm64"
|
||||
|
||||
for dll in "${MINGW_DLLS[@]}"; do
|
||||
find /usr/lib/gcc/x86_64-w64-mingw32/ -name "$dll" -exec cp {} "$DIST_DIR/" \; 2>/dev/null || true
|
||||
if [ ! -f "$DIST_DIR/$dll" ] && [ -f "/usr/x86_64-w64-mingw32/lib/$dll" ]; then
|
||||
cp "/usr/x86_64-w64-mingw32/lib/$dll" "$DIST_DIR/"
|
||||
fi
|
||||
done
|
||||
# LLVM-MinGW runtime DLLs for ARM64
|
||||
ARM64_DLLS=(
|
||||
libc++.dll
|
||||
libunwind.dll
|
||||
libwinpthread-1.dll
|
||||
)
|
||||
for dll in "${ARM64_DLLS[@]}"; do
|
||||
find /opt/llvm-mingw/aarch64-w64-mingw32/ -name "$dll" -exec cp {} "$DIST_DIR/" \; 2>/dev/null || true
|
||||
if [ ! -f "$DIST_DIR/$dll" ] && [ -f "$MINGW_SYSROOT/bin/$dll" ]; then
|
||||
cp "$MINGW_SYSROOT/bin/$dll" "$DIST_DIR/"
|
||||
fi
|
||||
done
|
||||
else
|
||||
PKG_NAME="asteria-qt-windows"
|
||||
|
||||
# Third-party DLLs from sysroot
|
||||
# MinGW-w64 runtime DLLs for x86_64
|
||||
MINGW_DLLS=(
|
||||
libgcc_s_seh-1.dll
|
||||
libstdc++-6.dll
|
||||
libwinpthread-1.dll
|
||||
)
|
||||
for dll in "${MINGW_DLLS[@]}"; do
|
||||
find /usr/lib/gcc/x86_64-w64-mingw32/ -name "$dll" -exec cp {} "$DIST_DIR/" \; 2>/dev/null || true
|
||||
if [ ! -f "$DIST_DIR/$dll" ] && [ -f "/usr/x86_64-w64-mingw32/lib/$dll" ]; then
|
||||
cp "/usr/x86_64-w64-mingw32/lib/$dll" "$DIST_DIR/"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Third-party DLLs from sysroot (if dynamically built)
|
||||
if [ -f "$MINGW_SYSROOT/lib/libuchardet.dll" ]; then
|
||||
cp "$MINGW_SYSROOT/lib/libuchardet.dll" "$DIST_DIR/"
|
||||
elif [ -f "$MINGW_SYSROOT/bin/libuchardet.dll" ]; then
|
||||
@@ -74,5 +109,5 @@ Qml2Imports = qml
|
||||
EOF
|
||||
|
||||
# Output flat directory — GitLab zips the artifact directory on download
|
||||
mkdir -p "$OUTPUT_DIR/asteria-qt-windows"
|
||||
cp -r "$DIST_DIR/"* "$OUTPUT_DIR/asteria-qt-windows/"
|
||||
mkdir -p "$OUTPUT_DIR/$PKG_NAME"
|
||||
cp -r "$DIST_DIR/"* "$OUTPUT_DIR/$PKG_NAME/"
|
||||
Reference in new issue
Block a user