Skip to content

Commit

Permalink
expand msvc ci with 32-bit ARM
Browse files Browse the repository at this point in the history
  • Loading branch information
guijan committed Jan 2, 2025
1 parent b272f54 commit b9848a0
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 15 deletions.
60 changes: 46 additions & 14 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,33 +218,65 @@ jobs:
strategy:
matrix:
cc: [cl, clang-cl]
arch: [x64, ARM64]
arch: [x86_64, x86, aarch64, arm]
env:
arch_map: |
{
"x86_64":
{
"_comment": "MSVC Dev CMD action name for this arch.",
"msvc_dev_cmd": "x64",
"_comment": "Is this a cross compiler?",
"msvc_cross": false,
},
"x86":
{
"_comment": "Take the chance to test more cross compilers.",
"msvc_dev_cmd": "amd64_x86",
"msvc_cross": true,
},
"aarch64":
{
"msvc_dev_cmd": "amd64_arm64",
"msvc_cross": true,
},
"arm":
{
"msvc_dev_cmd": "amd64_arm",
"msvc_cross": true,
},
}
steps:
- uses: actions/[email protected]
- run: |
pip install meson
choco install ninja innosetup groff -y
- uses: actions/[email protected]
- name: Enable ARM64 Developer Command Prompt
if: matrix.arch == 'ARM64'
- name: Enable Developer Command Prompt
uses: ilammy/[email protected]
with:
arch: amd64_arm64
- name: Enable x64 Developer Command Prompt
if: matrix.arch == 'x64'
uses: ilammy/[email protected]
- name: build
arch: ${{fromJSON(env.arch_map)[matrix.arch].msvc_dev_cmd}}
# Windows SDK 10.0.26100.0 dropped support for 32-bit ARM
sdk: ${{matrix.arch == 'arm' && '10.0.22621.0' | ''}}
run: |
if ("${{matrix.arch}}" -eq 'ARM64') {
if ("${{matrix.cc}}" -eq 'clang-cl') {
clang-cl -print-target-triple
}
$cross = "${{fromJSON(env.arch_map)[matrix.arch].msvc_cross}}"
if ($cross -eq 'true') {
$buildcc = "--native-file=.github/workflows/meson-vs-gcc.txt"
$hostarch = "--cross-file=.github/workflows/meson-vs-aarch64.txt"
$hostcc = "--cross-file=.github/workflows/meson-vs-${{matrix.cc}}.txt"
$hostarch = `
"--cross-file=.github/workflows/meson-vs-${{matrix.arch}}.txt"
$hostcc = `
"--cross-file=.github/workflows/meson-vs-${{matrix.cc}}.txt"
# clang-cl needs extra args to target a particular architecture.
$hostcc_args = if (${{matrix.cc}} -eq 'clang-cl') {
"--cross-file=.github/workflows/meson-vs-clang-cl-aarch64.txt"
# https://github.com/llvm/llvm-project/raw/1a0d0ae234544dc4978f1e12730408cb83f6b923/clang/test/Preprocessor/predefined-macros-no-warnings.c
$hostcc_args = if ('${{matrix.cc}}' -eq 'clang-cl') {
"--cross-file=.github/workflows/meson-vs-clang-cl-${{matrix.arch}}.txt"
}
} else {
$hostcc = "--native-file=.github/workflows/meson-vs-${{matrix.cc}}.txt"
$hostcc = `
"--native-file=.github/workflows/meson-vs-${{matrix.cc}}.txt"
}
# Don't do debug builds because that triggers a Windows bug:
# https://developercommunity.visualstudio.com/t/_setmaxstdio-hangs-the-program-if-the/10164855?space=62&q=setmaxstdio&viewtype=all
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/meson-vs-aarch64.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[host_machine]
system = 'windows'
cpu_family = 'aarch64'
cpu = 'armv8'
cpu = 'unused'
endian = 'little'
9 changes: 9 additions & 0 deletions .github/workflows/meson-vs-arm.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[binaries]
c_args = ['-DWINAPI_FAMILY=WINAPI_FAMILY_PC_APP']
cpp_args = c_args

[host_machine]
system = 'windows'
cpu_family = 'arm'
cpu = 'unused'
endian = 'little'
3 changes: 3 additions & 0 deletions .github/workflows/meson-vs-clang-cl-arm.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[binaries]
c = ['clang-cl', '--target=arm-win32-msvc']
cpp = c
3 changes: 3 additions & 0 deletions .github/workflows/meson-vs-clang-cl-x86.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[binaries]
c = ['clang-cl', '--target=i686-win32-msvc']
cpp = c
5 changes: 5 additions & 0 deletions .github/workflows/meson-vs-x86.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[host_machine]
system = 'windows'
cpu_family = 'x86'
cpu = 'unused'
endian = 'little'

0 comments on commit b9848a0

Please sign in to comment.