Skip to content

fng97/cpp-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++ Template

A C++ project template using Zig for the build system instead of the usual tools: clang, cmake, ninja, and ccache.

The template bundles your typical C++ testing, benchmarking, and formatting dependencies (ported to Zig): googletest, Google Benchmark, and clang-format.

Usage

Install Zig. Check out anyzig if you want a single zig executable for all versions of Zig.

The build system entrypoints are:

$ zig build --help
Usage: /path/to/zig/zig build [steps] [options]

Steps:
  install (default)            Copy build artifacts to prefix path
  uninstall                    Remove build artifacts from prefix path
  run                          Run the main executable
  gtest                        Run googletest
  gbench                       Run google benchmark
  test                         Run all checks
  fmt                          Format C/C++ files with clang-format

$ zig build test  # runs tests, benchmarks (single iter each), checks formatting

About

Quick, easy C++ development environment

Resources

License

Stars

Watchers

Forks

Contributors