Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for building with Meson #2530

Merged
merged 4 commits into from Oct 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/linux-meson-builds.yml
@@ -0,0 +1,43 @@
name: Linux builds (basic) using meson build system

on: [push, pull_request]

jobs:
build:
name: meson ${{matrix.cxx}}, C++${{matrix.std}}, ${{matrix.build_type}}
runs-on: ubuntu-22.04
strategy:
matrix:
cxx:
- g++-11
- clang++-11
build_type: [debug, release]
std: [14, 17]
include:
- cxx: clang++-11
other_pkgs: clang-11

horenmar marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/checkout@v2

- name: Prepare environment
run: sudo apt-get install -y meson ninja-build ${{matrix.other_pkgs}}

- name: Configure build
env:
CXX: ${{matrix.cxx}}
CXXFLAGS: -std=c++${{matrix.std}} ${{matrix.cxxflags}}
# Note: $GITHUB_WORKSPACE is distinct from ${{runner.workspace}}.
# This is important
run: |
meson -Dbuildtype=${{matrix.build_type}} ${{runner.workspace}}/meson-build

- name: Build tests + lib
working-directory: ${{runner.workspace}}/meson-build
run: ninja

- name: Run tests
working-directory: ${{runner.workspace}}/meson-build
# Hardcode 2 cores we know are there
run: |
meson test --verbose
1 change: 1 addition & 0 deletions .gitignore
@@ -1,4 +1,5 @@
*.build
!meson.build
*.pbxuser
*.mode1v3
*.ncb
Expand Down
17 changes: 17 additions & 0 deletions meson.build
@@ -0,0 +1,17 @@
# Copyright Catch2 Authors
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# https://www.boost.org/LICENSE_1_0.txt)

# SPDX-License-Identifier: BSL-1.0

project(
'catch2',
'cpp',
version : '3.1.0', # CML version placeholder, don't delete
horenmar marked this conversation as resolved.
Show resolved Hide resolved
license: 'BSL-1.0',
meson_version: '>=0.49.0'
)

subdir('src/catch2')
subdir('tests')