Skip to content

Commit 0f6748b

Browse files
authored
Merge pull request #5 from TheFreeman193/win-arm
Workflow: Add Windows ARM & ARM64 builds
2 parents c333b80 + 41e2e28 commit 0f6748b

1 file changed

Lines changed: 61 additions & 5 deletions

File tree

.github/workflows/build.yml

Lines changed: 61 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,23 @@ on:
88

99
jobs:
1010
build-windows:
11-
runs-on: windows-latest
1211
strategy:
1312
matrix:
14-
arch: [x64, x86]
13+
include:
14+
- arch: "x64"
15+
target: "x64"
16+
runner: windows-latest
17+
- arch: "x86"
18+
target: "x86"
19+
runner: windows-latest
20+
- arch: "arm64"
21+
target: "arm64"
22+
runner: windows-11-arm
23+
- arch: "arm"
24+
target: "amd64_arm"
25+
runner: windows-latest
26+
winsdk: "10.0.22621.0"
27+
runs-on: ${{ matrix.runner }}
1528
steps:
1629
- uses: actions/checkout@v4
1730

@@ -23,13 +36,56 @@ jobs:
2336
- name: Install Meson and Ninja
2437
run: pip install meson ninja
2538

26-
- name: Setup MSVC
39+
- name: Install Windows SDK 10.0.22621.0 C++ ARM Tools
40+
uses: ChristopheLav/windows-sdk-install@v1.0.4
41+
if: matrix.arch == 'arm'
42+
with:
43+
version-sdk: 22621
44+
features: 'OptionId.DesktopCPParm'
45+
46+
- name: Setup MSVC (native)
47+
if: matrix.arch != 'arm'
2748
uses: ilammy/msvc-dev-cmd@v1
2849
with:
29-
arch: ${{ matrix.arch }}
50+
arch: ${{ matrix.target }}
3051

31-
- name: Configure
52+
- name: Setup MSVC (arm 10.0.22621.0 cross)
53+
if: matrix.arch == 'arm'
54+
uses: ilammy/msvc-dev-cmd@v1
55+
with:
56+
arch: ${{ matrix.target }}
57+
sdk: ${{ matrix.winsdk }}
58+
59+
- name: Create cross-compilation file
60+
if: matrix.arch == 'arm'
61+
shell: pwsh
62+
run: |
63+
Set-Content windows-${{ matrix.arch }}.txt @'
64+
[binaries]
65+
c = 'cl.exe'
66+
cpp = 'cl.exe'
67+
exe_wrapper = 'dumpbin.exe'
68+
69+
[build_machine]
70+
system = 'windows'
71+
cpu_family = 'x86_64'
72+
cpu = 'x86_64'
73+
endian = 'little'
74+
75+
[host_machine]
76+
system = 'windows'
77+
cpu_family = '${{ matrix.arch }}'
78+
cpu = '${{ matrix.arch }}'
79+
endian = 'little'
80+
'@
81+
82+
- name: Configure (native)
83+
if: matrix.arch != 'arm'
3284
run: meson setup builddir --prefix=${{ github.workspace }}/install -Ddefault_library=static -Db_vscrt=static_from_buildtype
85+
86+
- name: Configure (cross)
87+
if: matrix.arch == 'arm'
88+
run: meson setup builddir --prefix=${{ github.workspace }}/install -Ddefault_library=static -Db_vscrt=static_from_buildtype --cross-file windows-${{ matrix.arch }}.txt
3389

3490
- name: Build
3591
run: meson compile -C builddir

0 commit comments

Comments
 (0)