diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 18c4c0e..02ba06a 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -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*' \ @@ -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 diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 351271d..0000000 --- a/.gitmodules +++ /dev/null @@ -1,7 +0,0 @@ -[submodule "subprojects/Catch2"] - path = subprojects/Catch2_ - url = https://github.com/catchorg/Catch2.git - branch = v2.x -[submodule "subprojects/fmt_"] - path = subprojects/fmt_ - url = https://github.com/fmtlib/fmt.git diff --git a/Makefile b/Makefile deleted file mode 100644 index c36f6b5..0000000 --- a/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -CXX?=g++ - -FLAGS=-std=c++20 -pthread -Wall -Wextra -Wpedantic -Wsign-conversion -DEBUG_FLAGS=-g -fprofile-arcs -ftest-coverage -RELEASE_FLAGS=-O3 - -.PHONY: all -all: test test-fmtlib test-stdfmt demo - -test: tests/test.cpp barkeep/barkeep.h - ${CXX} ${FLAGS} ${DEBUG_FLAGS} -I./ -I./subprojects/Catch2_/single_include/ tests/test.cpp -o test.out - -test-fmtlib: tests/test-fmtlib.cpp barkeep/barkeep.h - ${CXX} ${FLAGS} ${DEBUG_FLAGS} -I./ -I./subprojects/Catch2_/single_include/ -I./subprojects/fmt_/include/ tests/test-fmtlib.cpp -o test-fmtlib.out - -test-stdfmt: tests/test-stdfmt.cpp barkeep/barkeep.h - ${CXX} ${FLAGS} ${DEBUG_FLAGS} -I./ -I./subprojects/Catch2_/single_include/ tests/test-stdfmt.cpp -o test-stdfmt.out - -demo: tests/demo.cpp barkeep/barkeep.h - ${CXX} ${FLAGS} ${RELEASE_FLAGS} -I./ tests/demo.cpp -o demo.out - -.PHONY: clean -clean: - rm -rf *.out *.out.* *.gcda *.gcno diff --git a/README.md b/README.md index c357df0..5a74bfc 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/docs/README.md b/docs/README.md index 6d800a0..4cd8238 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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 @@ -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 diff --git a/subprojects/fmt.wrap b/subprojects/fmt.wrap index 2fb5b98..15a716a 100644 --- a/subprojects/fmt.wrap +++ b/subprojects/fmt.wrap @@ -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 \ No newline at end of file +fmt = fmt_dep