Skip to content

Commit

Permalink
Replace cmake with meson
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelxdd committed Oct 23, 2023
1 parent 8ca1354 commit bdfed8b
Show file tree
Hide file tree
Showing 13 changed files with 645 additions and 412 deletions.
30 changes: 30 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
Checks: [
'-*',
'clang-analyzer-*',
'-clang-analyzer-cplusplus.*',
'-clang-analyzer-security.*',
'-clang-analyzer-deadcode.DeadStores',
'clang-diagnostic-*',
'bugprone-*',
'-bugprone-reserved-identifier',
'concurrency-*',
'misc-*',
'performance-*',
'portability-*',
'readability-*',
'-readability-function-cognitive-complexity',
'-readability-identifier-length',
'-readability-isolate-declaration',
'-readability-magic-numbers',
]
CheckOptions:
readability-braces-around-statements.ShortStatementLines: 2
WarningsAsErrors: 'clang-analyzer-unix.*,clang-analyzer-core.NullDereference'
HeaderFileExtensions: ['h']
ImplementationFileExtensions: ['c']
HeaderFilterRegex: '\/src\/.*\.h$'
FormatStyle: none
InheritParentConfig: false
UseColor: true
...
156 changes: 156 additions & 0 deletions .github/workflows/meson.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
name: meson

on:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'

jobs:
linux:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
buildtype:
- plain
- debug
- debugoptimized
- release
- minsize
cc:
- gcc
- clang
env:
CC: ${{ matrix.cc }}
steps:
- uses: actions/checkout@main
- run: sudo apt-get update
- run: sudo apt-get install -yqq --no-install-recommends meson ninja-build
- run: meson setup build -Dbuildtype=${{ matrix.buildtype }} -Dtests=true
- run: ninja -Cbuild -v
- run: ninja -Cbuild -v test

alpine:
runs-on: ubuntu-latest
container:
image: ${{ matrix.image }}
strategy:
fail-fast: false
matrix:
image:
- alpine:edge
- alpine:latest
buildtype:
- plain
- debug
- debugoptimized
- release
- minsize
cc:
- gcc
- clang
env:
CC: ${{ matrix.cc }}
steps:
- uses: actions/checkout@main
- run: apk --no-cache add build-base meson ${{ matrix.cc }}
- run: meson setup build -Dbuildtype=${{ matrix.buildtype }} -Dtests=true
- run: meson compile -Cbuild -v
- run: meson test -Cbuild -v

macos:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-11
- macos-12
- macos-13
buildtype:
- plain
- debug
- debugoptimized
- release
- minsize
cc:
- clang
env:
CC: ${{ matrix.cc }}
steps:
- uses: actions/checkout@main
- run: brew install meson
- run: meson setup build -Dbuildtype=${{ matrix.buildtype }} -Dtests=true
- run: meson compile -Cbuild -v
- run: meson test -Cbuild -v

windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
buildtype:
- plain
- debug
- debugoptimized
- release
- minsize
steps:
- uses: actions/checkout@main
- uses: actions/setup-python@v4
- run: pip install meson ninja
- run: meson setup build -Dbuildtype=${{ matrix.buildtype }}
- run: meson compile -Cbuild -v
- run: meson test -Cbuild -v

muon:
runs-on: ubuntu-latest
container:
image: alpine:edge
strategy:
fail-fast: false
matrix:
buildtype:
- plain
- debug
- debugoptimized
- release
- minsize
cc:
- tcc
- pcc
env:
CC: ${{ matrix.cc }}
steps:
- uses: actions/checkout@main
- run: echo 'https://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories
- run: apk --no-cache add build-base muon ${{ matrix.cc }} valgrind samurai
- run: muon setup -Dbuildtype=${{ matrix.buildtype }} -Dtests=true -Dvalgrind=true build
- run: samu -Cbuild -v
- run: cd build && muon test -vv

valgrind:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- run: sudo apt-get update
- run: sudo apt-get install -yqq --no-install-recommends meson valgrind
- run: meson setup build -Dbuildtype=debug -Dtests=true -Dvalgrind=true
- run: meson compile -Cbuild -v
- run: meson test -Cbuild -v

analyzer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- run: sudo apt-get update
- run: sudo apt-get install -yqq --no-install-recommends meson
- run: meson setup build -Dbuildtype=debug -Dtests=true -Danalyzer=true
- run: meson compile -Cbuild -v
- run: meson test -Cbuild -v
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.*/
!.githooks/
!.github/
.vscode/
.vscode-ctags
/build*/
*.iml
CMakeUserPresets.json
9 changes: 8 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
types: [c]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.5.0
hooks:
- id: check-case-conflict
- id: check-merge-conflict
Expand All @@ -18,3 +18,10 @@ repos:
- id: end-of-file-fixer
- id: mixed-line-ending
args: ['--fix=lf']

- repo: https://github.com/adrienverge/yamllint
rev: v1.32.0
hooks:
- id: yamllint
args: ['-d=relaxed']
types: [yaml]
82 changes: 0 additions & 82 deletions CMakeLists.txt

This file was deleted.

7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# CIRCLEQ

[![Build](https://img.shields.io/github/actions/workflow/status/pavelxdd/circleq/meson.yml?branch=master&style=flat)](https://github.com/pavelxdd/circleq/actions)
[![License](https://img.shields.io/github/license/pavelxdd/circleq?style=flat&color=blue)](https://github.com/pavelxdd/circleq/blob/master/UNLICENSE)

CIRCLEQ is a single header intrusive circular linked list.

It is inspired by `<sys/queue.h>` from `glibc` and `FreeBSD`.

````bash
cmake . -Bbuild -DCMAKE_INSTALL_PREFIX=/usr/local
cmake --build build --target install
meson setup build -Dprefix=/usr/local
meson install -Cbuild
````
16 changes: 0 additions & 16 deletions cmake/modules/FindCUnit.cmake

This file was deleted.

Loading

0 comments on commit bdfed8b

Please sign in to comment.