Skip to content

Commit 1b41e63

Browse files
authored
add WoA native build to CI. (#1440)
1 parent a44a3f9 commit 1b41e63

File tree

6 files changed

+32
-12
lines changed

6 files changed

+32
-12
lines changed

.github/workflows/windows.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ jobs:
7171
METHOD: 'aqt'
7272
RELEASE: true
7373
os: windows-2025
74+
- QT_VERSION: '6.8.3'
75+
ARCH: 'arm64'
76+
HOST_ARCH: 'arm64'
77+
COMPILER: 'msvc2022_arm64'
78+
METHOD: 'aqt'
79+
RELEASE: false
80+
GENERATOR: 'Ninja'
81+
os: windows-11-arm
7482

7583
steps:
7684
- name: Checkout repository
@@ -84,10 +92,13 @@ jobs:
8492
key: ${{ runner.os }}-${{ matrix.QT_VERSION }}-${{ matrix.COMPILER }}-${{ matrix.CROSS_COMPILER }}-${{ secrets.CACHE_VERSION }}
8593

8694
- name: Install Qt setup(aqt)
87-
if: steps.cache.outputs.cache-hit != 'true'
95+
if: ( steps.cache.outputs.cache-hit != 'true' ) && ( matrix.METHOD == 'aqt' )
8896
uses: actions/setup-python@v5
97+
# aqt depends on pyppmd, which isn't supported on WoA as of pyppmd 1.1.1
98+
# force x64 python, which will run under emulation of WoA.
8999
with:
90100
python-version: '3.12'
101+
architecture: x64
91102

92103
- name: Install Qt
93104
if: steps.cache.outputs.cache-hit != 'true'

gui/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,16 @@ else()
239239
message(STATUS "Deploying with target qtpaths \"${_qtpaths_file}\".")
240240
endif()
241241
# generate architecture for inno setup
242-
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64")
242+
# don't trust CMAKE_SYSTEM_PROCESSOR https://gitlab.kitware.com/cmake/cmake/-/issues/15170#note_891234
243+
if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "arm64" OR CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "ARM64")
243244
set(_installer_arch arm64)
244245
else()
245246
set(_installer_arch x64compatible)
246247
endif()
247-
message(STATUS "CMAKE_SYSTEM_PROCESSOR is \"${CMAKE_SYSTEM_PROCESSOR}\". Building installer for architecture identifier \"${_installer_arch}\".")
248+
message(STATUS "PROCESSOR_ARCHITECTURE is \"$ENV{PROCESSOR_ARCHITECTURE}\".")
249+
message(STATUS "CMAKE_HOST_SYSTEM_PROCESSOR is \"${CMAKE_HOST_SYSTEM_PROCESSOR}\".")
250+
message(STATUS "CMAKE_SYSTEM_PROCESSOR is \"${CMAKE_SYSTEM_PROCESSOR}\".")
251+
message(STATUS "CMAKE_CXX_COMPILER_ARCHITECTURE_ID is \"${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}\". Building installer for architecture identifier \"${_installer_arch}\".")
248252
add_custom_target(package_app
249253
# deploy to a clean directory as different build systems create differently named debris in release.
250254
COMMAND ${CMAKE_COMMAND} -E remove_directory package

tools/ci_install_windows.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ set -ex
55
function validate() {
66
(
77
set +e
8-
# shellcheck source=/dev/null
9-
source "${CACHEDIR}/qt.env"
8+
PATH=${QTDIR}/bin:$PATH
109
if [ "$(cygpath -u "$(qmake -query QT_INSTALL_BINS)")" != "${QTDIR}/bin" ]; then
1110
echo "ERROR: unexpected Qt location." >&2
1211
exit 1
@@ -23,6 +22,7 @@ COMPILER=${2:-msvc2022_64}
2322
METHOD=${3:-default}
2423
CROSS_COMPILER=${4}
2524

25+
HOST=windows
2626
if [ "${COMPILER}" = "msvc2017_64" ]; then
2727
PACKAGE_SUFFIX=win64_msvc2017_64
2828
elif [ "${COMPILER}" = "msvc2017" ]; then
@@ -33,6 +33,9 @@ elif [ "${COMPILER}" = "msvc2019" ]; then
3333
PACKAGE_SUFFIX=win32_msvc2019
3434
elif [ "${COMPILER}" = "msvc2022_64" ]; then
3535
PACKAGE_SUFFIX=win64_msvc2022_64
36+
elif [ "${COMPILER}" = "msvc2022_arm64" ]; then
37+
PACKAGE_SUFFIX=win64_msvc2022_arm64
38+
HOST=windows_arm64
3639
else
3740
echo "ERROR: unrecognized Qt compiler ${COMPILER}." >&2
3841
exit 1
@@ -58,11 +61,10 @@ else
5861

5962
if [ "${METHOD}" = "aqt" ]; then
6063
pip3 install 'aqtinstall>=3.1.20'
61-
"${CI_BUILD_DIR}/tools/ci_install_qt.sh" windows "${QT_VERSION}" "${PACKAGE_SUFFIX}" "${CACHEDIR}/Qt"
64+
"${CI_BUILD_DIR}/tools/ci_install_qt.sh" "${HOST}" "${QT_VERSION}" "${PACKAGE_SUFFIX}" "${CACHEDIR}/Qt"
6265
if [ -n "${PACKAGE_SUFFIX_CROSS}" ]; then
63-
"${CI_BUILD_DIR}/tools/ci_install_qt.sh" windows "${QT_VERSION}" "${PACKAGE_SUFFIX_CROSS}" "${CACHEDIR}/Qt"
66+
"${CI_BUILD_DIR}/tools/ci_install_qt.sh" "${HOST}" "${QT_VERSION}" "${PACKAGE_SUFFIX_CROSS}" "${CACHEDIR}/Qt"
6467
fi
65-
echo "export PATH=${QTDIR}/bin:\$PATH" > "${CACHEDIR}/qt.env"
6668
else
6769
echo "ERROR: unknown installation method ${METHOD}." >&2
6870
exit 1

tools/ci_script_windows.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ param(
1111
$build_dir_name = "bld",
1212
$generator = "Ninja",
1313
$toolset = "",
14-
[ValidateSet("x86", "amd64", "amd64_x86", "x86_amd64")] $arch = "amd64"
14+
[ValidateSet("x86", "amd64", "amd64_x86", "x86_amd64", "arm64")] $arch = "amd64"
1515
)
1616
# the arch parameter values correspond to:
1717
# vcvarsall arch parameter x86 => host x86, target x86.
@@ -33,6 +33,7 @@ switch ($arch) {
3333
"amd64" { $platform = "x64" }
3434
"amd64_x86" { $platform = "Win32" }
3535
"x86_amd64" { $platform = "x64" }
36+
"arm64" { $platform = "ARM64" }
3637
}
3738
# make sure we are staring with a clean build directory
3839
Remove-Item $build_dir -Recurse -ErrorAction Ignore

tools/ci_setup_windows.ps1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
param(
1010
[string] $qtdir = "C:\Qt\6.5.3\msvc2019_64",
11-
[ValidateSet("x86", "amd64")][string] $arch = "amd64",
12-
[ValidateSet("x86", "amd64")][string] $host_arch = "amd64",
11+
[ValidateSet("x86", "amd64", "arm64")][string] $arch = "amd64",
12+
[ValidateSet("x86", "amd64", "arm64")][string] $host_arch = "amd64",
1313
[string] $vcversion
1414
)
1515

@@ -46,7 +46,9 @@ function Invoke-VSDevEnvironment($arch, $host_arch, $vcversion) {
4646

4747
$ErrorActionPreference = "Stop"
4848

49-
Invoke-QtEnvironment $qtdir
49+
# qtenv2.bat is not created with aqt 3.2.0 on WoA - https://github.com/miurahr/aqtinstall/pull/914
50+
#Invoke-QtEnvironment $qtdir
51+
[System.Environment]::SetEnvironmentVariable("Path", $(Join-Path "$qtdir" bin -Resolve) + ";" + $([System.Environment]::GetEnvironmentVariable("Path")))
5052
# verify qmake can be found.
5153
Get-Command qmake.exe | Format-Table -AutoSize -Wrap
5254

tools/ci_windows_cross_compile.ps1

100644100755
File mode changed.

0 commit comments

Comments
 (0)