Skip to content

Commit 0198bf7

Browse files
committed
Windows arm64
IB-6662 Signed-off-by: Raul Metsma <[email protected]>
1 parent dd6bc25 commit 0198bf7

File tree

4 files changed

+42
-50
lines changed

4 files changed

+42
-50
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,50 +23,48 @@ jobs:
2323
path: build/*.pkg
2424
windows:
2525
name: Build on Windows
26-
runs-on: windows-2025
26+
runs-on: ${{ matrix.platform == 'arm64' && 'windows-11-arm' || 'windows-2025' }}
2727
strategy:
2828
matrix:
2929
vcver: [143]
30+
platform: [x64, arm64]
3031
env:
3132
VER_SUFFIX: .VS${{ matrix.vcver }}
3233
steps:
3334
- name: Checkout
3435
uses: actions/checkout@v5
3536
with:
3637
submodules: recursive
37-
- name: Cache vcpkg
38-
uses: actions/cache@v4
39-
with:
40-
path: ${{ github.workspace }}/vcpkg_cache
41-
key: vcpkg-${{ matrix.vcver }}-${{ hashFiles('vcpkg.json') }}
42-
- name: Prepare vcpkg
43-
uses: lukka/run-vcpkg@v11
44-
with:
45-
vcpkgJsonGlob: ./vcpkg.json
46-
runVcpkgInstall: true
47-
env:
48-
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
49-
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/build/vcpkg_installed
5038
- name: Install Qt
5139
uses: jurplel/install-qt-action@v4
5240
with:
53-
version: 6.10.0
54-
arch: win64_msvc2022_64
41+
version: 6.10.1
42+
arch: ${{ matrix.platform == 'arm64' && 'win64_msvc2022_arm64' || 'win64_msvc2022_64' }}
43+
cache: true
44+
cache-key-prefix: qt-6.10.1-${{ matrix.platform }}
5545
- name: Setup dev env
5646
uses: ilammy/msvc-dev-cmd@v1
5747
with:
58-
arch: x64
48+
arch: ${{ matrix.platform }}
5949
- name: Install WiX
6050
run: |
6151
dotnet tool install -g wix --version 6.0.2
6252
wix extension -g add WixToolset.UI.wixext/6.0.2
53+
- name: Cache vcpkg
54+
uses: actions/cache@v4
55+
with:
56+
path: ${{ github.workspace }}/vcpkg_cache
57+
key: vcpkg-${{ matrix.vcver }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json') }}
6358
- name: Build
59+
env:
60+
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
6461
run: |
65-
cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo `
66-
-DCMAKE_TOOLCHAIN_FILE=${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake
62+
cmake -A ${{ matrix.platform }} -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo `
63+
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake `
64+
-DVCPKG_TARGET_TRIPLET=${{ matrix.platform }}-windows
6765
cmake --build build --target installer
6866
- name: Archive artifacts
6967
uses: actions/upload-artifact@v4
7068
with:
71-
name: msi_${{ matrix.vcver }}_x64
69+
name: msi_${{ matrix.vcver }}_${{ matrix.platform }}
7270
path: build/*.msi

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ else()
150150

151151
find_package(OpenSSL 3.0.0 REQUIRED)
152152
find_package(Qt6 6.0.0 REQUIRED COMPONENTS Core Widgets Network LinguistTools)
153+
message("VC Tools Dir: ${VCToolsInstallDir}")
154+
message("VC Version: ${VCToolsVersion}")
153155

154156
add_executable(${PROJECT_NAME} WIN32
155157
${SOURCES}
@@ -201,12 +203,12 @@ else()
201203
if(NOT EXISTS "${SSL_PATH}")
202204
get_filename_component(SSL_PATH "${OPENSSL_INCLUDE_DIR}/../bin" ABSOLUTE)
203205
endif()
204-
set(MSI_FILE "ID-Updater-${VERSION}$ENV{VER_SUFFIX}.$ENV{PLATFORM}")
206+
set(MSI_FILE "ID-Updater-${VERSION}$ENV{VER_SUFFIX}.${MSVC_CXX_ARCHITECTURE_ID}")
205207
get_target_property(qtCore_install_prefix Qt6::qmake IMPORTED_LOCATION)
206208
get_filename_component(qtCore_install_prefix ${qtCore_install_prefix} DIRECTORY)
207209
add_custom_target(installer DEPENDS ${PROJECT_NAME}
208210
COMMAND wix.exe build -nologo
209-
-arch $ENV{PLATFORM}
211+
-arch ${MSVC_CXX_ARCHITECTURE_ID}
210212
-ext WixToolset.UI.wixext
211213
-bv WixUIDialogBmp=${CMAKE_SOURCE_DIR}/common/dlgbmp.bmp
212214
-bv WixUIBannerBmp=${CMAKE_SOURCE_DIR}/common/banner.bmp

ScheduledUpdateTask.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,13 @@
3232
#endif
3333

3434
template <class T>
35-
class CPtr
35+
struct CPtr
3636
{
37-
T *d;
38-
public:
39-
CPtr(T *p = nullptr): d(p) {}
40-
~CPtr() { if(d) d->Release(); }
41-
inline T* operator->() const { return d; }
42-
inline operator T*() const { return d; }
43-
inline T** operator&() { return &d; }
37+
T *d{};
38+
~CPtr() { if(d) d->Release(); }
39+
inline T* operator->() const { return d; }
40+
inline operator T*() const { return d; }
41+
inline T** operator&() { return &d; }
4442
};
4543

4644
class ScheduledUpdateTaskPrivate
@@ -79,8 +77,8 @@ bool ScheduledUpdateTask::configure(ScheduledUpdateTask::Interval interval)
7977
if( FAILED(d->service->NewTask( 0, &task )) )
8078
return false;
8179

82-
CPtr<ITaskSettings> settings;
83-
if( SUCCEEDED(task->get_Settings( &settings )) )
80+
if(CPtr<ITaskSettings> settings;
81+
SUCCEEDED(task->get_Settings(&settings)))
8482
{
8583
settings->put_StartWhenAvailable(VARIANT_TRUE);
8684
settings->put_RunOnlyIfNetworkAvailable(VARIANT_TRUE);

idupdater.wxs

Lines changed: 12 additions & 18 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="Open-EID Updater" UpgradeCode="d3aa8bd7-e1e6-46d0-97a6-c9b87d2b830b"
21+
<Package Name="Open-EID Updater $(sys.BUILDARCH)" UpgradeCode="d3aa8bd7-e1e6-46d0-97a6-c9b87d2b830b"
2222
Language="1033" Version="!(bind.FileVersion.id_updater.exe)" Codepage="1251" Manufacturer="RIA" InstallerVersion="500">
2323
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
2424
<Icon Id="appicon.ico" SourceFile="$(var.appicon)" />
@@ -35,7 +35,7 @@
3535
<File Id="id_updater.exe" Source="$(var.updater_path)" KeyPath="yes" />
3636
<RegistryValue Root="HKMU" Key="Software\[Manufacturer]\Open-EID"
3737
Name="Installed" Value="[INSTALLFOLDER]" Type="string" />
38-
<?if $(sys.BUILDARCH) = x64 ?>
38+
<?if $(sys.BUILDARCH) != x86 ?>
3939
<RegistryValue Root="HKMU" Key="Software\Wow6432Node\[Manufacturer]\Open-EID"
4040
Name="Installed" Value="[INSTALLFOLDER]" Type="string" />
4141
<?endif?>
@@ -55,21 +55,15 @@
5555
<File Name="Qt6PrintSupport$(var.qt_suffix).dll" />
5656
<File Name="Qt6Svg$(var.qt_suffix).dll" />
5757
<File Name="Qt6Widgets$(var.qt_suffix).dll" />
58+
<File Name="Qt6SvgWidgets$(var.qt_suffix).dll" />
59+
<?if $(sys.BUILDARCH) != arm64 ?>
5860
<File Name="D3DCompiler_47.dll" />
5961
<File Name="opengl32sw.dll" />
60-
<File Name="Qt6SvgWidgets$(var.qt_suffix).dll" />
61-
<Directory Id="platforms" Name="platforms">
62-
<File Source="$(var.qt_path)\..\plugins\platforms\qwindows$(var.qt_suffix).dll" />
63-
</Directory>
64-
<Directory Id="tls" Name="tls">
65-
<File Source="$(var.qt_path)\..\plugins\tls\qopensslbackend$(var.qt_suffix).dll" />
66-
</Directory>
67-
<Directory Id="styles" Name="styles">
68-
<File Source="$(var.qt_path)\..\plugins\styles\qmodernwindowsstyle$(var.qt_suffix).dll" />
69-
</Directory>
70-
<Directory Id="imageformats" Name="imageformats">
71-
<File Source="$(var.qt_path)\..\plugins\imageformats\qsvg$(var.qt_suffix).dll" />
72-
</Directory>
62+
<?endif?>
63+
<File Subdirectory="platforms" Source="$(var.qt_path)\..\plugins\platforms\qwindows$(var.qt_suffix).dll" />
64+
<File Subdirectory="tls" Source="$(var.qt_path)\..\plugins\tls\qopensslbackend$(var.qt_suffix).dll" />
65+
<File Subdirectory="styles" Source="$(var.qt_path)\..\plugins\styles\qmodernwindowsstyle$(var.qt_suffix).dll" />
66+
<File Subdirectory="imageformats" Source="$(var.qt_path)\..\plugins\imageformats\qsvg$(var.qt_suffix).dll" />
7367
</Directory>
7468
</StandardDirectory>
7569

0 commit comments

Comments
 (0)