Skip to content

CMake build

CMake build #1

Workflow file for this run

name: "CMake build"
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
name: ${{ matrix.toolchain }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
toolchain:
- linux-gcc
- macos-clang
- windows-msvc
configuration:
- Release
include:
- toolchain: linux-gcc
os: ubuntu-latest
compiler: gcc
- toolchain: macos-clang
os: macos-latest
compiler: clang
- toolchain: windows-msvc
os: windows-latest
compiler: msvc
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 5
- name: Build libraries with ${{ matrix.compiler }}
run: |
if [ "${{ matrix.compiler }}" == "msvc" ]; then
cmake -S . -B build
cmake --build build --config ${{ matrix.configuration }}
elif [ "${{ matrix.compiler }}" == "mingw" ]; then
cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -G "MinGW Makefiles"
cmake --build build
else
cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DCMAKE_C_FLAGS="-std=c89 -Wall -Wextra"
cmake --build build
fi