A sample startup project based on modern C++ guidelines. The example code implements a solution to the first problem on Project Euler
Automatically generated documentation
- Checkout the project:
$ git clone https://github.com/planetmarshall/cpp_sample_project.git $ cd cpp_sample_project
- Install conan
pip install conan --upgrade
- Install dependencies. The preset name should match the preset you will use
with CMake. Check the
CMakePresets.json
file for the available presets or add your own.$ conan install . -if build/<preset> -of build/<preset> --build missing
- Configure with CMake
$ cmake --preset <preset>
- Build
$ cmake --build build/<preset>
- Run tests
$ ctest -vvv build/<preset>
The Github Workflow builds and tests the project using the following compilers and platforms, across both Debug and Release builds using both Shared and Static libraries.
Compiler warnings are set at a high level (-Wall -Wpedantic -Wextra -Wconversion -Wconditional-uninitialized
for
GCC and Clang, /W4 /fpermissive-
for MSVC) and warnings are treated as errors.
- GCC
- Clang with LLVM libc++
- Visual Studio
- Visual Studio with Clang-CL
- Apple Clang on ARM64
In addition, clang-tidy
is run on any changed files, and documentation is
generated by Sphinx and uploaded to Github Pages