Skip to content

Commit 082be64

Browse files
committed
Build windows Arm64 binaries
IB-6662 Signed-off-by: Raul Metsma <[email protected]>
1 parent b689214 commit 082be64

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
with:
5050
version: 6.10.1
5151
arch: clang_64
52+
cache: true
5253
- name: Build
5354
run: |
5455
cmake "-GNinja" -B build -S . -DCMAKE_BUILD_TYPE=RelWithDebInfo \
@@ -70,7 +71,7 @@ jobs:
7071
container: ubuntu:${{ matrix.container }}
7172
strategy:
7273
matrix:
73-
container: ['22.04', '24.04', '25.04', '25.10']
74+
container: ['22.04', '24.04', '25.10']
7475
arch: ['amd64', 'arm64']
7576
env:
7677
DEBIAN_FRONTEND: noninteractive
@@ -140,10 +141,11 @@ jobs:
140141
path: build/qdigidoc4*.rpm
141142
windows:
142143
name: Build on Windows
143-
runs-on: windows-2025
144+
runs-on: ${{ matrix.platform == 'arm64' && 'windows-11-arm' || 'windows-2025' }}
144145
strategy:
145146
matrix:
146147
vcver: [143]
148+
platform: [x64, arm64]
147149
env:
148150
VER_SUFFIX: .VS${{ matrix.vcver }}
149151
steps:
@@ -153,7 +155,7 @@ jobs:
153155
with:
154156
workflow: build.yml
155157
branch: master
156-
name: msi_${{ matrix.vcver }}_x64
158+
name: msi_${{ matrix.vcver }}_${{ matrix.platform }}
157159
path: ./
158160
repo: open-eid/libdigidocpp
159161
- name: Install artifact
@@ -164,39 +166,34 @@ jobs:
164166
uses: actions/cache@v4
165167
with:
166168
path: ${{ github.workspace }}/vcpkg_cache
167-
key: vcpkg-${{ matrix.vcver }}-${{ hashFiles('vcpkg.json') }}
168-
- name: Prepare vcpkg
169-
uses: lukka/run-vcpkg@v11
170-
with:
171-
vcpkgJsonGlob: ./vcpkg.json
172-
runVcpkgInstall: true
173-
env:
174-
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
175-
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/build/vcpkg_installed
169+
key: vcpkg-${{ matrix.vcver }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json') }}
176170
- name: Install Qt
177171
uses: jurplel/install-qt-action@v4
178172
with:
179173
version: 6.10.1
180-
arch: win64_msvc2022_64
174+
arch: ${{ matrix.platform == 'arm64' && 'win64_msvc2022_arm64' || 'win64_msvc2022_64' }}
175+
cache: true
181176
- name: Setup dev env
182177
uses: ilammy/msvc-dev-cmd@v1
183178
with:
184-
arch: x64
179+
arch: ${{ matrix.platform }}
185180
- name: Install WiX
186181
run: |
187182
dotnet tool install -g wix --version 6.0.2
188183
wix extension -g add WixToolset.UI.wixext/6.0.2
189184
- name: Build
185+
env:
186+
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
190187
run: |
191188
cmake "-GNinja" -B build -S . -DCMAKE_BUILD_TYPE=RelWithDebInfo `
192-
-DCMAKE_TOOLCHAIN_FILE=${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake
189+
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
193190
cmake --build build --target msi
194191
cmake --build build --target msishellext
195192
cmake --build build --target appx
196193
- name: Archive artifacts
197194
uses: actions/upload-artifact@v5
198195
with:
199-
name: msi_${{ matrix.vcver }}_x64
196+
name: msi_${{ matrix.vcver }}_${{ matrix.platform }}
200197
path: |
201198
build/*.msi
202199
build/*.appx

client/CMakeLists.txt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
get_target_property(qtCore_install_prefix Qt6::qmake IMPORTED_LOCATION)
2-
get_filename_component(qtCore_install_prefix ${qtCore_install_prefix} DIRECTORY)
31
get_filename_component(TSL_FILENAME ${TSL_URL} NAME_WLE)
42
set(TSL_LIST ${TSL_FILENAME} ${TSL_INCLUDE})
53
list(TRANSFORM TSL_LIST APPEND .xml)
@@ -16,7 +14,7 @@ else()
1614
OUTPUT ${TSL_LIST}
1715
DEPENDS TSLDownload
1816
COMMAND $<TARGET_FILE:TSLDownload> ${CMAKE_CURRENT_BINARY_DIR} ${TSL_URL} ${TSL_INCLUDE}
19-
WORKING_DIRECTORY ${qtCore_install_prefix}
17+
WORKING_DIRECTORY ${QT_HOST_PATH}
2018
)
2119
endif()
2220

@@ -241,10 +239,11 @@ elseif(WIN32)
241239
${CMAKE_SOURCE_DIR}/common/WelcomeDlg.wxs
242240
${CMAKE_SOURCE_DIR}/common/WixUI_Minimal.wxs
243241
)
242+
get_filename_component(QT_BASE_DIR "${Qt6_DIR}/../../.." ABSOLUTE)
244243
add_custom_target(msi DEPENDS ${PROJECT_NAME}
245244
COMMAND ${WIX_CMD} -o "${MSI_FILE}.msi"
246245
#Build MSI with QT
247-
COMMAND ${WIX_CMD} -d qt_path=${qtCore_install_prefix} -o "${MSI_FILE}.qt.msi"
246+
COMMAND ${WIX_CMD} -d qt_path=${QT_BASE_DIR}/bin -o "${MSI_FILE}.qt.msi"
248247
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
249248
)
250249
if(SIGNCERT)
@@ -261,10 +260,12 @@ elseif(WIN32)
261260
endif()
262261
set(PLATFORM $ENV{PLATFORM})
263262
configure_file(${CMAKE_SOURCE_DIR}/AppxManifest.xml.cmake ${CMAKE_BINARY_DIR}/AppxManifest.xml)
264-
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
265-
set(OPENSSL_SUFFIX "-x64")
266-
else()
263+
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64")
264+
set(OPENSSL_SUFFIX "-arm64")
265+
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
267266
set(OPENSSL_SUFFIX "")
267+
else()
268+
set(OPENSSL_SUFFIX "-x64")
268269
endif()
269270
add_custom_target(appx DEPENDS ${PROJECT_NAME}
270271
COMMAND ${CMAKE_COMMAND} -E remove ${MSI_FILE}.appx

qdigidoc4.wxs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<?if $(sys.BUILDARCH) = x64 ?>
2-
<?define OpenSSLSuffix = "-x64" ?>
3-
<?else?>
1+
<?if $(sys.BUILDARCH) = x86 ?>
42
<?define OpenSSLSuffix = "" ?>
3+
<?else?>
4+
<?define OpenSSLSuffix = "-$(sys.BUILDARCH)" ?>
55
<?endif?>
66

77
<?if $(env.VisualStudioVersion) = "17.0" ?>
@@ -18,7 +18,7 @@
1818

1919
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
2020
xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
21-
<Package Name="DigiDoc4 Client" UpgradeCode="67932072-aa9e-45e3-b697-d825349f273d"
21+
<Package Name="DigiDoc4 Client $(sys.BUILDARCH)" UpgradeCode="67932072-aa9e-45e3-b697-d825349f273d"
2222
Language="1033" Version="!(bind.FileVersion.qdigidoc4.exe)" Manufacturer="RIA" Scope="perMachine">
2323
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
2424
<Icon Id="qdigidoc4.ico" SourceFile="$(var.ico_path)" />
@@ -92,9 +92,11 @@
9292
<File Source="$(var.qt_path)\Qt6PrintSupport$(var.qt_suffix).dll" />
9393
<File Source="$(var.qt_path)\Qt6Svg$(var.qt_suffix).dll" />
9494
<File Source="$(var.qt_path)\Qt6Widgets$(var.qt_suffix).dll" />
95+
<File Source="$(var.qt_path)\Qt6SvgWidgets$(var.qt_suffix).dll" />
96+
<?if $(sys.BUILDARCH) != arm64 ?>
9597
<File Source="$(var.qt_path)\D3DCompiler_47.dll" />
9698
<File Source="$(var.qt_path)\opengl32sw.dll" />
97-
<File Source="$(var.qt_path)\Qt6SvgWidgets$(var.qt_suffix).dll" />
99+
<?endif?>
98100
<File Subdirectory="platforms" Source="$(var.qt_path)\..\plugins\platforms\qwindows$(var.qt_suffix).dll" />
99101
<File Subdirectory="tls" Source="$(var.qt_path)\..\plugins\tls\qopensslbackend$(var.qt_suffix).dll" />
100102
<File Subdirectory="styles" Source="$(var.qt_path)\..\plugins\styles\qmodernwindowsstyle$(var.qt_suffix).dll" />

0 commit comments

Comments
 (0)