Add meson build system #91
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# simple ci config the idea is to use the latest ubuntu, macos, and windows that github runners give us | |
# test a few different compilers (gcc/clang) in debug and release | |
# and run our tests via ctest | |
name: CI | |
on: | |
push: | |
# Jobs are skipped when ONLY Markdown (*.md) files are changed | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
jobs: | |
linux: | |
name: '${{ matrix.os }} / ${{ matrix.build-type }} / ${{ matrix.compiler-desc }} ' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
build: [1, 2, 3, 4] | |
include: | |
# ------------------------------------------------------------------- | |
# CLANG, Release | |
# ------------------------------------------------------------------- | |
- build: 1 | |
build-type: Release | |
build-shared: 'ON' | |
cxx-standard: 17 | |
cc_compiler: clang | |
cxx_compiler: clang++ | |
compiler-desc: clang | |
os: ubuntu-latest | |
# ------------------------------------------------------------------- | |
# CLANG, Debug | |
# ------------------------------------------------------------------- | |
- build: 2 | |
build-type: Debug | |
build-shared: 'ON' | |
cxx-standard: 17 | |
cc_compiler: clang | |
cxx_compiler: clang++ | |
compiler-desc: clang | |
os: ubuntu-latest | |
# ------------------------------------------------------------------- | |
# gcc, Release | |
# ------------------------------------------------------------------- | |
- build: 3 | |
build-type: Release | |
build-shared: 'ON' | |
cxx-standard: 17 | |
cxx-compiler: g++ | |
cc-compiler: gcc | |
compiler-desc: gcc | |
os: ubuntu-latest | |
# ------------------------------------------------------------------- | |
# gcc, Debug | |
# ------------------------------------------------------------------- | |
- build: 4 | |
build-type: Debug | |
build-shared: 'ON' | |
cxx-standard: 17 | |
cxx-compiler: g++ | |
cc-compiler: gcc | |
compiler-desc: gcc | |
os: ubuntu-latest | |
env: | |
CXX: ${{ matrix.cxx-compiler }} | |
CC: ${{ matrix.cc-compiler }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Create build directories | |
run: | | |
mkdir _install | |
mkdir _build | |
- name: Configure | |
run: | | |
cmake .. \ | |
-DCMAKE_INSTALL_PREFIX=../_install \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \ | |
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \ | |
-DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \ | |
-DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \ | |
-DBUILD_SHARED_LIBS=${{ matrix.build-shared }} \ | |
working-directory: _build | |
- name: Build | |
run: | | |
cmake --build . \ | |
--target install \ | |
--config ${{ matrix.build-type }} | |
working-directory: _build | |
- name: Test | |
run: | | |
ctest --build-config ${{ matrix.build_type }} --verbose | |
working-directory: _build | |
# --------------------------------------------------------------------------- | |
# macOS | |
# --------------------------------------------------------------------------- | |
macos: | |
name: '${{ matrix.os }} / ${{ matrix.build-type }}' | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
build: [1, 2] | |
include: | |
# Release | |
- build: 1 | |
build-type: Release | |
build-shared: 'ON' | |
cxx-standard: 17 | |
os: macos-latest | |
# Debug | |
- build: 2 | |
build-type: Debug | |
build-shared: 'ON' | |
build-docs: 'OFF' | |
cxx-standard: 17 | |
os: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Create build directories | |
run: | | |
mkdir _install | |
mkdir _build | |
- name: Configure | |
run: | | |
cmake ../. \ | |
-DCMAKE_INSTALL_PREFIX=../_install \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \ | |
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \ | |
-DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \ | |
-DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \ | |
-DBUILD_SHARED_LIBS=${{ matrix.build-shared }} | |
working-directory: _build | |
- name: Build | |
run: | | |
cmake --build . \ | |
--target install \ | |
--config ${{ matrix.build-type }} \ | |
working-directory: _build | |
- name: Test | |
run: | | |
ctest --build-config ${{ matrix.build_type }} --verbose | |
working-directory: _build | |
# --------------------------------------------------------------------------- | |
# Windows | |
# --------------------------------------------------------------------------- | |
windows: | |
name: '${{ matrix.os }} / ${{ matrix.build-type }}' | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
build: [1, 2] | |
include: | |
# Release | |
- build: 1 | |
build-type: Release | |
build-shared: 'ON' | |
cxx-standard: 17 | |
os: windows-latest | |
# Debug | |
- build: 2 | |
build-type: Debug | |
build-shared: 'ON' | |
cxx-standard: 17 | |
os: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Create build directories | |
run: | | |
mkdir _install | |
mkdir _build | |
shell: bash | |
- name: Configure | |
# the windows build needs the -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS to work | |
run: | | |
cmake ../. \ | |
-DCMAKE_INSTALL_PREFIX=../_install \ | |
-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS='ON'\ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \ | |
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \ | |
-DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \ | |
-DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \ | |
-DBUILD_SHARED_LIBS=${{ matrix.build-shared }} | |
shell: bash | |
working-directory: _build | |
- name: Build | |
run: | | |
cmake --build . \ | |
--target install \ | |
--config ${{ matrix.build-type }} | |
shell: bash | |
working-directory: _build | |
- name: Test | |
run: | | |
ctest -C ${{ matrix.build-type }} | |
shell: bash | |
working-directory: _build |