Skip to content

Commit

Permalink
expand Visual Studio CI with code from dictpw
Browse files Browse the repository at this point in the history
  • Loading branch information
guijan committed Dec 29, 2024
1 parent 09bbc61 commit aa87429
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 10 deletions.
40 changes: 30 additions & 10 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,26 +226,46 @@ jobs:
strategy:
matrix:
cc: [cl, clang-cl]
arch: [x64, ARM64]
steps:
- uses: actions/[email protected]
- run: pip install meson ninja
- run: |
pip install meson
choco install ninja -y
- uses: actions/[email protected]
- uses: ilammy/[email protected]
- name: Enable ARM64 Developer Command Prompt
if: matrix.arch == 'ARM64'
uses: ilammy/[email protected]
with:
arch: amd64_arm64
- name: Enable x64 Developer Command Prompt
if: matrix.arch == 'x64'
uses: ilammy/[email protected]
- name: build
run: |
pwsh -c {
$env:CC="${{ matrix.cc }}";
# 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
meson setup build --buildtype=release -Dtest_system=true
if ("${{matrix.arch}}" -eq 'ARM64') {
$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"
# 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"
}
} else {
$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
meson setup build -Dbuildtype=release `
-Db_vscrt=static_from_buildtype `
$buildcc $hostarch $hostcc $hostcc_args
meson compile -C build
- name: test
run: meson test --no-suite system -C build
- name: test_system
run: meson test --suite system -C build || true
- name: test system
run: meson test --suite system -C build
- uses: actions/[email protected]
if: always()
with:
name: meson-logs-vs-${{matrix.cc}}
name: meson-logs-vs-${{matrix.cc}}-${{matrix.arch}}
path: build/meson-logs
5 changes: 5 additions & 0 deletions .github/workflows/meson-vs-aarch64.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[host_machine]
system = 'windows'
cpu_family = 'aarch64'
cpu = 'armv8'
endian = 'little'
6 changes: 6 additions & 0 deletions .github/workflows/meson-vs-cl.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[binaries]
c = 'cl'
c_ld = 'link'
cpp = c
cpp_ld = c_ld
ar = 'lib'
3 changes: 3 additions & 0 deletions .github/workflows/meson-vs-clang-cl-aarch64.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[binaries]
c = ['clang-cl', '--target=aarch64-win32-msvc']
cpp = c
7 changes: 7 additions & 0 deletions .github/workflows/meson-vs-clang-cl.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[binaries]
c = 'clang-cl'
c_ld = 'lld-link'
cpp = c
cpp_ld = c_ld
ar = 'llvm-lib'
strip = 'llvm-strip'
7 changes: 7 additions & 0 deletions .github/workflows/meson-vs-gcc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[binaries]
c = 'gcc'
c_ld = 'bfd'
cpp = 'g++'
cpp_ld = c_ld
ar = 'ar'
strip = 'strip'

0 comments on commit aa87429

Please sign in to comment.