Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/ci-meson.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Meson Continuous Integrations

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
cpp_compiler: [g++, clang++]
sanitize: [address ,undefined, thread]

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Meson and Boost.Test
run: sudo apt-get --quiet --yes install meson libboost-test-dev

- name: Setup
env:
CXX: ${{ matrix.cpp_compiler }}
run: meson setup build -Dwerror=true -Dwarning_level=3 -Db_sanitize=${{ matrix.sanitize }}

- name: Compile
run: meson compile -C build

- name: Test
run: meson test -C build --print-errorlogs
8 changes: 7 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,25 @@ if get_option('tests')
endif

if get_option('benchmarks')
incompatible_cpp_std = ['c++98', 'c++03', 'c++11', 'c++14', 'gnu++03', 'gnu++11', 'gnu++14', 'vc++14']
if incompatible_cpp_std.contains(get_option('cpp_std'))
error('Benchmarks require C++17 or higher')
endif

cxx = meson.get_compiler('cpp')
dl_dep = cxx.find_library('dl')
xenium_dep = declare_dependency(include_directories : '../xenium')
boost_dep = dependency('boost')
tbb_dep = cxx.find_library('tbb')
moodycamel_dep = declare_dependency(include_directories : '../')

executable(
benchmarks_exe = executable(
'benchmarks',
['src/benchmarks.cc', 'src/cpu_base_frequency.cc', 'src/huge_pages.cc'],
include_directories : ['src'],
dependencies : [atomic_queue_dep, dl_dep, xenium_dep, boost_dep, tbb_dep, moodycamel_dep],
)
benchmark('benchmarks', benchmarks_exe)
endif

install_headers(
Expand Down
4 changes: 2 additions & 2 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
option('benchmarks', type : 'boolean', value : true,
description : 'Build benchmarks (requires Boost, TBB, Xenium and moodycamel)')
option('benchmarks', type : 'boolean', value : false,
description : 'Build benchmarks (requires Boost, TBB, Xenium, moodycamel and C++17)')
option('tests', type : 'boolean', value : true,
description : 'Build tests and example (requires Boost)')