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
52 changes: 18 additions & 34 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,34 @@ on:
pull_request:
branches: [ main ]
jobs:
build-and-test-for-cpp-make:
name: "Build and test for C++ with make"
build-and-test-for-cpp-meson:
name: "Build and test for C++ with meson"
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
submodules: false
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: "Install tooling"
run: |
sudo apt-get install lcov
sudo apt-get install lcov ninja-build
g++-13 --version
gcov-13 --version
lcov --version
- run: |
CXX=g++-13 make -j3
./test.out
./test-fmtlib.out
./test-stdfmt.out
lcov -c -d . -o cov.info --gcov-tool gcov-13 --ignore-errors mismatch && \
pip install meson pytest
- name: "Build and test"
run: |
CXX=g++-13 meson setup build --buildtype=debug --warnlevel=3 -Db_coverage=true
meson compile -C build tests
./build/tests/test.out
./build/tests/test-fmtlib.out
./build/tests/test-stdfmt.out
- name: "Generate coverage"
run: |
lcov -c -d build -o cov.info --gcov-tool gcov-13 --ignore-errors mismatch
lcov --gcov-tool gcov-13 \
--remove cov.info \
'/usr/include*' \
Expand All @@ -38,30 +46,6 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: barkeep.info
# - run: ./demo.out
build-and-test-for-cpp-meson:
name: "Build and test for C++ with meson"
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: false
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: "Install tooling"
run: |
g++-13 --version
gcov-13 --version
pip install meson pytest
sudo apt install ninja-build
- run: |
CXX=g++-13 meson setup build --buildtype=release --warnlevel=3
meson compile -C build tests
./build/tests/test.out
./build/tests/test-fmtlib.out
./build/tests/test-stdfmt.out
build-and-test-for-python:
name: "Build and test for Python"
timeout-minutes: 10
Expand Down
7 changes: 0 additions & 7 deletions .gitmodules

This file was deleted.

24 changes: 0 additions & 24 deletions Makefile

This file was deleted.

63 changes: 9 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -693,64 +693,19 @@ Still, this section details how to build the demos, tests and python bindings an

### No tooling

If you don't want to deal with even a Makefile, you can simply invoke the compiler on the corresponding `.cpp` files.

- First clone with submodules:
```bash
git clone --recursive https://github.com/oir/barkeep
cd barkeep
```
Or if you already cloned without the `recursive` option, you can init the submodules:
```bash
git clone https://github.com/oir/barkeep
cd barkeep
git submodule update --init
```
- Then, build & run the demo like:
```bash
g++ -std=c++20 -I./ tests/demo.cpp -o demo.out
./demo.out
```
(You can replace `g++` with your choice of compiler like `clang`.)
- Or, build the tests like:
```bash
g++ -std=c++20 -I./ -I./subprojects/Catch2_/single_include/ tests/test.cpp -o test.out
g++ -std=c++20 -I./ -I./subprojects/Catch2_/single_include/ tests/test-stdfmt.cpp -o test-stdfmt.out
g++ -std=c++20 -I./ -I./subprojects/Catch2_/single_include/ -I./subprojects/fmt_/include/ tests/test-fmtlib.cpp -o test-fmtlib.out
./test.out
./test-stdfmt.out
./test-fmtlib.out
```

> Detail: Github submodules are staged in folders that end with a `_` to avoid clashing with Meson's subproject downloading.

_Python bindings are slightly more involved, therefore a proper build system is recommended, [see below](#build-system-meson)._


### Minimal tooling: Make

If you don't want to deal with a complex build system, but also don't want to invoke raw compiler commands, you can use `make`.

Clone the repo with submodules as in the [previous section](#no-tooling) and `cd` into it.

Build demo and tests:
```bash
make all
```

...and run:
If you don't want to deal with a build system, you can simply invoke the compiler to build the demo:
```bash
git clone https://github.com/oir/barkeep
cd barkeep
g++ -std=c++20 -I./ tests/demo.cpp -o demo.out
./demo.out
./test.out
./test-stdfmt.out
./test-fmtlib.out
```

_Python bindings are slightly more involved, therefore a proper build system is recommended, [see below](#build-system-meson)._
(You can replace `g++` with your choice of compiler like `clang`.)

### Build system: Meson
To build the test suites or the Python bindings, use Meson (below).

Meson has its own subproject staging logic, thus cloning the submodules is not needed.
### Build system: Meson

- Get [Meson](https://mesonbuild.com/Getting-meson.html) and [ninja](https://ninja-build.org/), e.g.:
```bash
Expand All @@ -776,10 +731,10 @@ Meson has its own subproject staging logic, thus cloning the submodules is not n
The output of `configure` command will list those, e.g.:
```
Message: Python targets:
Message: barkeep.cpython-39-darwin
Message: barkeep.cpython-310-darwin
Message: barkeep.cpython-311-darwin
Message: barkeep.cpython-312-darwin
Message: barkeep.cpython-313-darwin
Message: barkeep.cpython-314-darwin
```
```bash
meson compile -C build python
Expand Down
63 changes: 9 additions & 54 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -645,64 +645,19 @@ Still, this section details how to build the demos, tests and python bindings an

### No tooling

If you don't want to deal with even a Makefile, you can simply invoke the compiler on the corresponding `.cpp` files.

- First clone with submodules:
```bash
git clone --recursive https://github.com/oir/barkeep
cd barkeep
```
Or if you already cloned without the `recursive` option, you can init the submodules:
```bash
git clone https://github.com/oir/barkeep
cd barkeep
git submodule update --init
```
- Then, build & run the demo like:
```bash
g++ -std=c++20 -I./ tests/demo.cpp -o demo.out
./demo.out
```
(You can replace `g++` with your choice of compiler like `clang`.)
- Or, build the tests like:
```bash
g++ -std=c++20 -I./ -I./subprojects/Catch2_/single_include/ tests/test.cpp -o test.out
g++ -std=c++20 -I./ -I./subprojects/Catch2_/single_include/ tests/test-stdfmt.cpp -o test-stdfmt.out
g++ -std=c++20 -I./ -I./subprojects/Catch2_/single_include/ -I./subprojects/fmt_/include/ tests/test-fmtlib.cpp -o test-fmtlib.out
./test.out
./test-stdfmt.out
./test-fmtlib.out
```

?> Detail: Github submodules are staged in folders that end with a `_` to avoid clashing with Meson's subproject downloading.

_Python bindings are slightly more involved, therefore a proper build system is recommended, [see below](#build-system-meson)._


### Minimal tooling: Make

If you don't want to deal with a complex build system, but also don't want to invoke raw compiler commands, you can use `make`.

Clone the repo with submodules as in the [previous section](#no-tooling) and `cd` into it.

Build demo and tests:
```bash
make all
```

...and run:
If you don't want to deal with a build system, you can simply invoke the compiler to build the demo:
```bash
git clone https://github.com/oir/barkeep
cd barkeep
g++ -std=c++20 -I./ tests/demo.cpp -o demo.out
./demo.out
./test.out
./test-stdfmt.out
./test-fmtlib.out
```

_Python bindings are slightly more involved, therefore a proper build system is recommended, [see below](#build-system-meson)._
(You can replace `g++` with your choice of compiler like `clang`.)

### Build system: Meson
To build the test suites or the Python bindings, use Meson (below).

Meson has its own subproject staging logic, thus cloning the submodules is not needed.
### Build system: Meson

- Get [Meson](https://mesonbuild.com/Getting-meson.html) and [ninja](https://ninja-build.org/), e.g.:
```bash
Expand All @@ -728,10 +683,10 @@ Meson has its own subproject staging logic, thus cloning the submodules is not n
The output of `configure` command will list those, e.g.:
```
Message: Python targets:
Message: barkeep.cpython-39-darwin
Message: barkeep.cpython-310-darwin
Message: barkeep.cpython-311-darwin
Message: barkeep.cpython-312-darwin
Message: barkeep.cpython-313-darwin
Message: barkeep.cpython-314-darwin
```
```bash
meson compile -C build python
Expand Down
20 changes: 10 additions & 10 deletions subprojects/fmt.wrap
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[wrap-file]
directory = fmt-11.0.1
source_url = https://github.com/fmtlib/fmt/archive/11.0.1.tar.gz
source_filename = fmt-11.0.1.tar.gz
source_hash = 7d009f7f89ac84c0a83f79ed602463d092fbf66763766a907c97fd02b100f5e9
patch_filename = fmt_11.0.1-1_patch.zip
patch_url = https://wrapdb.mesonbuild.com/v2/fmt_11.0.1-1/get_patch
patch_hash = 0a8b93d1ee6d84a82d3872a9bfb4c3977d8a53f7f484d42d1f7ed63ed496d549
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/fmt_11.0.1-1/fmt-11.0.1.tar.gz
wrapdb_version = 11.0.1-1
directory = fmt-12.0.0
source_url = https://github.com/fmtlib/fmt/archive/12.0.0.tar.gz
source_filename = fmt-12.0.0.tar.gz
source_hash = aa3e8fbb6a0066c03454434add1f1fc23299e85758ceec0d7d2d974431481e40
patch_filename = fmt_12.0.0-1_patch.zip
patch_url = https://wrapdb.mesonbuild.com/v2/fmt_12.0.0-1/get_patch
patch_hash = 307f288ebf3850abf2f0c50ac1fb07de97df9538d39146d802f3c0d6cada8998
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/fmt_12.0.0-1/fmt-12.0.0.tar.gz
wrapdb_version = 12.0.0-1

[provide]
fmt = fmt_dep
fmt = fmt_dep
Loading