From b9848a08d1e34b3d78d704645b12d31d00563f62 Mon Sep 17 00:00:00 2001 From: Guilherme Janczak Date: Thu, 2 Jan 2025 03:26:52 +0000 Subject: [PATCH] expand msvc ci with 32-bit ARM --- .github/workflows/build-and-test.yml | 60 ++++++++++++++++----- .github/workflows/meson-vs-aarch64.txt | 2 +- .github/workflows/meson-vs-arm.txt | 9 ++++ .github/workflows/meson-vs-clang-cl-arm.txt | 3 ++ .github/workflows/meson-vs-clang-cl-x86.txt | 3 ++ .github/workflows/meson-vs-x86.txt | 5 ++ 6 files changed, 67 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/meson-vs-arm.txt create mode 100644 .github/workflows/meson-vs-clang-cl-arm.txt create mode 100644 .github/workflows/meson-vs-clang-cl-x86.txt create mode 100644 .github/workflows/meson-vs-x86.txt diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 724f178..8b13b29 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -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/setup-python@v5.3.0 - run: | pip install meson choco install ninja innosetup groff -y - uses: actions/checkout@v4.2.2 - - name: Enable ARM64 Developer Command Prompt - if: matrix.arch == 'ARM64' + - name: Enable Developer Command Prompt uses: ilammy/msvc-dev-cmd@v1.13.0 with: - arch: amd64_arm64 - - name: Enable x64 Developer Command Prompt - if: matrix.arch == 'x64' - uses: ilammy/msvc-dev-cmd@v1.13.0 - - 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 diff --git a/.github/workflows/meson-vs-aarch64.txt b/.github/workflows/meson-vs-aarch64.txt index d49cd23..e6828e4 100644 --- a/.github/workflows/meson-vs-aarch64.txt +++ b/.github/workflows/meson-vs-aarch64.txt @@ -1,5 +1,5 @@ [host_machine] system = 'windows' cpu_family = 'aarch64' -cpu = 'armv8' +cpu = 'unused' endian = 'little' diff --git a/.github/workflows/meson-vs-arm.txt b/.github/workflows/meson-vs-arm.txt new file mode 100644 index 0000000..f54741b --- /dev/null +++ b/.github/workflows/meson-vs-arm.txt @@ -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' diff --git a/.github/workflows/meson-vs-clang-cl-arm.txt b/.github/workflows/meson-vs-clang-cl-arm.txt new file mode 100644 index 0000000..1655369 --- /dev/null +++ b/.github/workflows/meson-vs-clang-cl-arm.txt @@ -0,0 +1,3 @@ +[binaries] +c = ['clang-cl', '--target=arm-win32-msvc'] +cpp = c diff --git a/.github/workflows/meson-vs-clang-cl-x86.txt b/.github/workflows/meson-vs-clang-cl-x86.txt new file mode 100644 index 0000000..5330009 --- /dev/null +++ b/.github/workflows/meson-vs-clang-cl-x86.txt @@ -0,0 +1,3 @@ +[binaries] +c = ['clang-cl', '--target=i686-win32-msvc'] +cpp = c diff --git a/.github/workflows/meson-vs-x86.txt b/.github/workflows/meson-vs-x86.txt new file mode 100644 index 0000000..27a9c10 --- /dev/null +++ b/.github/workflows/meson-vs-x86.txt @@ -0,0 +1,5 @@ +[host_machine] +system = 'windows' +cpu_family = 'x86' +cpu = 'unused' +endian = 'little'