Skip to content

Commit 87adf52

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

File tree

3 files changed

+36
-47
lines changed

3 files changed

+36
-47
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,20 @@ jobs:
1414
uses: actions/checkout@v5
1515
- name: Build
1616
run: |
17-
cmake -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_BUILD_TYPE=RelWithDebInfo -S . -B build
17+
cmake -S . -B build -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_BUILD_TYPE=RelWithDebInfo
1818
cmake --build build --target pkgbuild
1919
- name: Archive artifacts
20-
uses: actions/upload-artifact@v4
20+
uses: actions/upload-artifact@v5
2121
with:
2222
name: macOS
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:
@@ -38,35 +39,31 @@ jobs:
3839
uses: actions/cache@v4
3940
with:
4041
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
42+
key: vcpkg-${{ matrix.vcver }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json') }}
5043
- name: Install Qt
5144
uses: jurplel/install-qt-action@v4
5245
with:
53-
version: 6.10.0
54-
arch: win64_msvc2022_64
46+
version: 6.10.1
47+
arch: ${{ matrix.platform == 'arm64' && 'win64_msvc2022_arm64' || 'win64_msvc2022_64' }}
48+
cache: true
5549
- name: Setup dev env
5650
uses: ilammy/msvc-dev-cmd@v1
5751
with:
58-
arch: x64
52+
arch: ${{ matrix.platform }}
5953
- name: Install WiX
6054
run: |
6155
dotnet tool install -g wix --version 6.0.2
6256
wix extension -g add WixToolset.UI.wixext/6.0.2
6357
- name: Build
58+
env:
59+
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
6460
run: |
65-
cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo `
66-
-DCMAKE_TOOLCHAIN_FILE=${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake
61+
cmake -A ${{ matrix.platform }} -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo `
62+
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake `
63+
-DVCPKG_TARGET_TRIPLET=${{ matrix.platform }}-windows
6764
cmake --build build --target installer
6865
- name: Archive artifacts
69-
uses: actions/upload-artifact@v4
66+
uses: actions/upload-artifact@v5
7067
with:
71-
name: msi_${{ matrix.vcver }}_x64
68+
name: msi_${{ matrix.vcver }}_${{ matrix.platform }}
7269
path: build/*.msi

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)