Skip to content

Commit fbb3ea2

Browse files
committed
Build arm64 package with python support
IB-8503 Signed-off-by: Raul Metsma <[email protected]>
1 parent b780536 commit fbb3ea2

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
uses: actions/cache@v4
9494
with:
9595
path: ${{ github.workspace }}/vcpkg_cache
96-
key: vcpkg-${{ matrix.target }}-${{ hashFiles('.github/workflows/*', 'vcpkg.json', 'vcpkg-ports/**', 'CMakeLists.txt', '**/CMakeLists.txt', 'CMakePresets.json') }}
96+
key: vcpkg-${{ matrix.target }}-${{ hashFiles('vcpkg.json', 'vcpkg-ports/**') }}
9797
- name: Prepare vcpkg
9898
uses: lukka/run-vcpkg@v11
9999
with:
@@ -181,10 +181,13 @@ jobs:
181181
include:
182182
- platform: x86
183183
setenv: amd64_x86
184+
python: 32
184185
- platform: x64
185186
setenv: amd64
187+
python: 64
186188
- platform: arm64
187189
setenv: amd64_arm64
190+
python: arm64
188191
env:
189192
VER_SUFFIX: .VS${{ matrix.toolset }}
190193
CXXFLAGS: '/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR' # https://github.com/actions/runner-images/issues/10004
@@ -195,7 +198,7 @@ jobs:
195198
uses: actions/cache@v4
196199
with:
197200
path: ${{ github.workspace }}/vcpkg_cache
198-
key: vcpkg-${{ matrix.toolset }}-${{ matrix.platform }}-${{ hashFiles('.github/workflows/*', 'vcpkg.json', 'vcpkg-ports/**', 'CMakeLists.txt', '**/CMakeLists.txt', 'CMakePresets.json') }}
201+
key: vcpkg-${{ matrix.toolset }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json', 'vcpkg-ports/**') }}
199202
- name: Prepare vcpkg
200203
uses: lukka/run-vcpkg@v11
201204
with:
@@ -207,23 +210,20 @@ jobs:
207210
VCPKG_DEFAULT_TRIPLET: ${{ matrix.platform }}-windows
208211
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg_installed_${{ matrix.platform }}
209212
- name: Install dependencies
210-
run: winget install --silent --accept-source-agreements --accept-package-agreements swig doxygen
213+
run: winget install --silent --accept-source-agreements --accept-package-agreements swig doxygen 9NQ7512CXL7T
211214
- uses: actions/setup-java@v4
212215
with:
213216
distribution: 'temurin'
214217
java-version: '17'
215-
- uses: actions/setup-python@v5
216-
if: matrix.platform != 'arm64'
217-
with:
218-
python-version: 3.12
219-
architecture: ${{ matrix.platform }}
220218
- name: Build
221219
run: |
220+
& "$env:LOCALAPPDATA\Microsoft\WindowsApps\py.exe" install --target=.\python\${{ matrix.platform }} 3.12-${{ matrix.python }}
222221
$swig = (Get-Item "$env:LOCALAPPDATA\Microsoft\WinGet\Links\swig.exe").Target
223222
& "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat" ${{ matrix.setenv }} "&&" pwsh build.ps1 `
224223
-swig $swig `
225224
-doxygen "C:/Program files/doxygen/bin/doxygen.exe" `
226-
-boost
225+
-boost `
226+
-python ${{ github.workspace }}/python
227227
- name: Archive artifacts
228228
uses: actions/upload-artifact@v4
229229
with:

build.ps1

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ param(
1616
[string]$swig = $null,
1717
[string]$doxygen = $null,
1818
[switch]$boost = $false,
19-
[string]$sign = $null
19+
[string]$sign = $null,
20+
[string]$python = $null
2021
)
2122

2223
Try {
@@ -43,14 +44,16 @@ if($doxygen) {
4344
$cmakeext += "-DDOXYGEN_EXECUTABLE=$doxygen"
4445
}
4546
if($platform -eq "arm64" -and $env:VSCMD_ARG_HOST_ARCH -ne "arm64") {
46-
$cmakeext += "-DCMAKE_DISABLE_FIND_PACKAGE_Python3=yes"
47-
$wixext += "-d", "disablePython=1"
4847
$boost = $false
4948
}
5049
if($boost) {
5150
$cmakeext += "-DVCPKG_MANIFEST_FEATURES=tests"
5251
$target += "check"
5352
}
53+
if($python) {
54+
$cmakeext += "-DPython3_ROOT_DIR=$python/$platform"
55+
$wixext += "-d", "python=1"
56+
}
5457

5558
foreach($type in @("Debug", "RelWithDebInfo")) {
5659
$buildpath = $platform+$type

libdigidocpp.wxs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
<File Name="digidoc_csharp.dll" />
6565
<File Name="digidoc_java.dll" />
6666
<File Source="$(var.libdigidocpp)\share\digidocpp\digidocpp.jar" />
67-
<?ifndef var.disablePython ?>
67+
<?ifdef var.python ?>
6868
<File Name="_digidoc_python.pyd" />
6969
<File Name="digidoc.py" />
7070
<?endif?>
@@ -88,7 +88,7 @@
8888
<?ifdef var.swig ?>
8989
<File Name="digidoc_csharpd.dll" />
9090
<File Name="digidoc_javad.dll" />
91-
<?ifndef var.disablePython ?>
91+
<?ifdef var.python ?>
9292
<File Name="_digidoc_pythond.pyd" />
9393
<?endif?>
9494
<?endif?>

0 commit comments

Comments
 (0)