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.
- 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
git clone https://github.com/tomasmark79/NixonCpp.git
cd NixonCpp
nix develop ./nix
make testTo create a project from the template:
./scripts/rename.sh MyApp MyAppLib myappFor repeated use, source scripts/clonenixoncpp.sh and run:
clonenixoncpp MyProject MyApp MyAppLib myapp| 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.
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.
- VS Code tasks: .vscode/tasks.json
- Devcontainer: .devcontainer/devcontainer.json
- Meson options: meson_options.txt
Nix is recommended. Native builds may also use a local C++20 compiler, Meson, Ninja, and the required libraries; cross-builds require Nix.