A modern C++2x project template, using xmake, Github Actions and Docker.
xmake is a fully-fledged and modern C++ package manager + build system + project generator. For installation and usage refer to its docs.
xrepo install <PKG>
xmake build <TARGET>
xmake run <TARGET>
xmake install
All the project configuration is done in the file ./xmake.lua
(refer to xmake
docs). The basic struture is as follows:
- A provider shared library that abstracts all the domain logic (classes, functions, ...). (lib.a)
- Any number of consumers targets that should use the provider library (e.g. app).
- A unit test target.
- A benchmark target.
The project use the cppdev environment for building.
The scripts ./scripts/build
, ./scripts/test
and ./scripts/publish
are
usefull for building the project inside a Docker container. Refer to the
./Dockerfile
for configuration, multi-stage build and other tweaks.
This project uses the Doxygen doc generation. Refer
the ./Doxyfile
for configuration. You can run doxygen
for generating the
docs.
For a CI/CD pipeline, the Github Actions
tool is used. The default configuration is located in
./.github/workflows/cicd.yml
, and describes a simple cascading pipeline:
- The project is built in a container.
- The targets are copied to the host.
- Unit tests are executed.
- A docker image is published
- A github release is published.