CPP17 is intended to serve as a base skeleton/framework for C++17 projects with the following features:
- Configures via CMake
- Integrates with GitHub Workflows for CI, which uses Ubuntu 18.04 and installs following to build:
- cmake (3.15+)
- g++-8
- ninja (1.8+)
- (Optional) clang-8, lld-8
git clone https://github.com/karnkaul/CPP17
Command line:
CONFIG=Debug # Or Release / RelWithDebInfo / etc
cmake -G Ninja . -Bout/$CONFIG -DCMAKE_BUILD_TYPE=$CONFIG
GUI:
- Select repo root as Source directory
- Select
out/...
as the Build directory (config subdirectory not required for IDE project generators) - Click Configure
- For single-configuration generators: enter the desired value for
CMAKE_BUILD_TYPE
- Click Generate
If using IDE project generators, open the generated project/solution/workspace in the corresponding IDE and build BUILD_ALL
.
Command line:
cmake --build out/$CONFIG
- Fork the repository in into your own account
- Follow Build Sample to ensure project works
- Replace with your source code and CMake files
All GitHub related files are in .github
:
workflows/ci.yml
sets up the overall workflow; edit theon:
sections to adjust automated build triggersCI/pre-build.sh
sets up the build environment; optionally pass "TRUE" to also installclang
andllvm
CI/build-config.sh
builds the config passed as the first argument (Release
if empty); pass "TRUE" as the second argument to use/usr/bin/clang++
In repository settings, select "Branches" and set up protections for branch wildcards to enable:
- Prevention of branch deletions / force pushes
- Require status checks to pass
- After a CI Action has run, it will appear as an option here (to be selected as "Required")