From 91fdfcd179f4185a9df0f8f637ef5a8b7a0bce97 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Wed, 18 Mar 2026 03:25:01 +0100 Subject: [PATCH] Specify MSVC architecture using presets Shortens CI command lines slightly, and documents the requirement. --- .../workflows/create-release-artifacts.yml | 4 +--- .github/workflows/testing.yml | 4 +--- CMakePresets.json | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/create-release-artifacts.yml b/.github/workflows/create-release-artifacts.yml index fe249503..74227618 100644 --- a/.github/workflows/create-release-artifacts.yml +++ b/.github/workflows/create-release-artifacts.yml @@ -23,10 +23,8 @@ jobs: include: - bits: 32 arch: x86 - platform: Win32 - bits: 64 arch: x86_x64 - platform: x64 fail-fast: false steps: - name: Get version from tag @@ -43,7 +41,7 @@ jobs: # We instruct CMake to download and build third-party projects outside of our source tree, # otherwise they can trigger `-Werror=dev` (from the `develop` preset). run: | - cmake -S . -B build -A ${{ matrix.platform }} -DFETCHCONTENT_BASE_DIR="$TEMP/cmake-deps" -DBISON_EXECUTABLE=bison/win_bison.exe + cmake -S . -B build --preset msvc${{ matrix.bits }} -DFETCHCONTENT_BASE_DIR="$TEMP/cmake-deps" -DBISON_EXECUTABLE=bison/win_bison.exe cmake --build build cmake --install build --config Release --prefix install_dir --verbose - name: Package binaries diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 3cd9e0ee..c4694b5e 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -150,10 +150,8 @@ jobs: include: - bits: 32 arch: x86 - platform: Win32 - bits: 64 arch: x86_x64 - platform: x64 fail-fast: false runs-on: ${{ matrix.os }} steps: @@ -166,7 +164,7 @@ jobs: # We instruct CMake to download and build third-party projects outside of our source tree, # otherwise they can trigger `-Werror=dev` (from the `develop` preset). run: | # ASan seems to be broken on Windows, so we disable it. - cmake -S . -B build -A ${{ matrix.platform }} --preset develop -DFETCHCONTENT_BASE_DIR="$TEMP/cmake-deps" -DBISON_EXECUTABLE=bison/win_bison.exe -DSANITIZERS=OFF + cmake -S . -B build --preset develop-msvc${{ matrix.bits }} -DFETCHCONTENT_BASE_DIR="$TEMP/cmake-deps" -DBISON_EXECUTABLE=bison/win_bison.exe -DSANITIZERS=OFF cmake --build build cmake --install build --config Debug --prefix install_dir --verbose - name: Package binaries diff --git a/CMakePresets.json b/CMakePresets.json index dd7a35ee..f94bdc0b 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -12,6 +12,25 @@ }, "warnings": { "uninitialized": true }, "errors": { "dev": true } + }, + { + "name": "develop-msvc32", + "inherits": ["develop", "msvc32"] + }, + { + "name": "develop-msvc64", + "inherits": ["develop", "msvc64"] + }, + + { + "name": "msvc32", + "description": "Flags for building 32-bit executables with MSVC", + "architecture": "Win32" + }, + { + "name": "msvc64", + "description": "Flags for building 64-bit executables with MSVC", + "architecture": "x64" } ] }