Skip to content

Add CMake build support with cross-platform compatibility #3

Add CMake build support with cross-platform compatibility

Add CMake build support with cross-platform compatibility #3

Workflow file for this run

name: CI
on:
push:
branches: [ master, cmake ]
pull_request:
branches: [ master ]
jobs:
# Original Makefile build (Linux only)
makefile:
name: Linux (Makefile)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: make all
- name: Test
run: make test
# CMake builds (all platforms)
cmake:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
name: Linux (CMake)
cmake_generator: "Unix Makefiles"
- os: macos-latest
name: macOS (CMake)
cmake_generator: "Unix Makefiles"
- os: windows-latest
name: Windows (CMake)
cmake_generator: "Visual Studio 17 2022"
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure CMake
run: cmake -B build -G "${{ matrix.cmake_generator }}"
- name: Build
run: cmake --build build --config Release
- name: Run Tests
run: ctest --test-dir build -C Release --output-on-failure