Skip to content

Commit 5ad40a2

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

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,13 @@ jobs:
191191
include:
192192
- platform: x86
193193
setenv: amd64_x86
194+
python: 32
194195
- platform: x64
195196
setenv: amd64
197+
python: 64
196198
- platform: arm64
197199
setenv: amd64_arm64
200+
python: arm64
198201
env:
199202
VER_SUFFIX: .VS${{ matrix.toolset }}
200203
CXXFLAGS: '/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR' # https://github.com/actions/runner-images/issues/10004
@@ -217,23 +220,20 @@ jobs:
217220
VCPKG_DEFAULT_TRIPLET: ${{ matrix.platform }}-windows
218221
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg_installed_${{ matrix.platform }}
219222
- name: Install dependencies
220-
run: winget install --silent --accept-source-agreements --accept-package-agreements swig doxygen
223+
run: winget install --silent --accept-source-agreements --accept-package-agreements swig doxygen 9NQ7512CXL7T
221224
- uses: actions/setup-java@v4
222225
with:
223226
distribution: 'temurin'
224227
java-version: '17'
225-
- uses: actions/setup-python@v5
226-
if: matrix.platform != 'arm64'
227-
with:
228-
python-version: 3.12
229-
architecture: ${{ matrix.platform }}
230228
- name: Build
231229
run: |
230+
& "$env:LOCALAPPDATA\Microsoft\WindowsApps\py.exe" install --target=.\python\${{ matrix.platform }} 3.12-${{ matrix.python }}
232231
$swig = (Get-Item "$env:LOCALAPPDATA\Microsoft\WinGet\Links\swig.exe").Target
233232
& "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat" ${{ matrix.setenv }} "&&" pwsh build.ps1 `
234233
-swig $swig `
235234
-doxygen "C:/Program files/doxygen/bin/doxygen.exe" `
236-
-boost
235+
-boost `
236+
-python ${{ github.workspace }}/python
237237
- name: Archive artifacts
238238
uses: actions/upload-artifact@v4
239239
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)