Skip to content

Repository files navigation

NixonCpp

Quality Native Static analysis Sanitizers Cross builds Documentation

NixonCpp logo

NixonCpp is a C++20 project template for applications and libraries. It combines Meson with reproducible Nix environments, native tests, static analysis, sanitizers, packaging, and cross-compilation for Linux ARM64, Windows, and WebAssembly.

Features

  • Application, shared library, and static library targets
  • Nix development environments and reproducible package builds
  • GoogleTest, clang-format, clang-tidy, AddressSanitizer, and UBSan
  • Cross-builds for aarch64-linux, Windows, and WebAssembly
  • Doxygen documentation published through GitHub Pages
  • Project renaming, packaging, VS Code, devcontainer, and Codespaces support

Quick start

git clone https://github.com/tomasmark79/NixonCpp.git
cd NixonCpp
nix develop ./nix
make test

To create a project from the template:

./scripts/rename.sh MyApp MyAppLib myapp

For repeated use, source scripts/clonenixoncpp.sh and run:

clonenixoncpp MyProject MyApp MyAppLib myapp

Common commands

Command Purpose
make build Native release build
make debug Native debug build
make test Build and run native tests
make format Format C and C++ sources
make format-check Verify formatting without modifying files
make check Run clang-tidy
make test-sanitizers Run tests with ASan and UBSan
make cross-all Build all cross-compilation targets
make package-all Create native and cross-platform packages
make nix-build Build the Nix package
make doxygen Generate documentation locally

Run make help for the complete target list.

Documentation

API documentation is available at https://tomasmark79.github.io/NixonCpp/html/index.html. The Documentation workflow regenerates and publishes it from main; generated HTML is not stored in the branch.

Development environment

Nix is recommended. Native builds may also use a local C++20 compiler, Meson, Ninja, and the required libraries; cross-builds require Nix.

License

MIT

About

Project template for a C++ application and library, set up with Meson/Nix tooling, tests, documentation, and packaging. (modular layout, CI-ready, cross-build targets).

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Contributors

Languages