Skip to content

Fix CMake target detection and remove compiler warnings #83

Fix CMake target detection and remove compiler warnings

Fix CMake target detection and remove compiler warnings #83

name: Build-Windows-MSYS2
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build_windows_msys2:
permissions:
contents: write
runs-on: windows-latest
timeout-minutes: 60
env:
BUILD_TYPE: Debug
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: true
clean: true
fetch-depth: 1
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-cmake
mingw-w64-x86_64-ninja
git
base-devel
- name: Cache FetchContent downloads
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/build/_deps
key: ${{ runner.os }}-msys2-fetchcontent-${{ hashFiles('CMakeLists.txt') }}
restore-keys: |
${{ runner.os }}-msys2-fetchcontent-
- name: Prepare build directory
run: |
rm -rf build
mkdir -p build
- name: Build with MSYS2 (FetchContent mode)
run: |
cd build
echo "Building with FetchContent to download all external systems..."
cmake .. \
-G Ninja \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DMESSAGING_USE_FETCHCONTENT=ON \
-DMESSAGING_BUILD_TESTS=ON \
-DMESSAGING_BUILD_EXAMPLES=ON \
-DCMAKE_INSTALL_PREFIX="../target"
cmake --build . --parallel
- name: Run tests
run: |
cd build
ctest --output-on-failure --parallel || echo "Some tests failed"
- name: Upload build artifacts
if: success()
uses: actions/upload-artifact@v4
with:
name: messaging-system-windows-msys2-${{ env.BUILD_TYPE }}
path: |
${{ github.workspace }}/build/bin/
${{ github.workspace }}/target/
if-no-files-found: warn