Skip to content

hentai-chan/cpp-template

Repository files navigation

Hello World

Recommended Reading

Resources created by members of the cpp-gamedev organization:

Requirements

In general, you need to install

sudo pacman -S cmake clang --noconfirm

For VS Code specifically, you also need to install

Dev Notes

To configure a new build, enter the root directory, and run

cmake . -B out/debug -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

After that, build the application:

cmake --build out/debug

From here on you can use the visual debugger on VS Code to create new builds by using the short cuts ctrlshiftB followed by F5. Alternatively, you can also use the run.sh shell script to run these commands individually. This can also be added as a custom task in .vscode/tasks.json.

Clang

This project uses the LLVM style for clang-format:

clang-format --style=llvm -dump-config > .clang-format

See the docs for all options. Run clang-tidy -list-checks in the command line to list all enabled checks.

clang-tidy ./src/*.[ch]pp -dump-config -checks='clang-analyzer-*,modernize-*,performance-*,readability-*' > .clang-tidy

Run clang-tidy. Add the -fix option to automatically apply suggested fixes.

python run-clang-tidy.py -config='' -p ./out/debug -header-filter='.*' ./src/*.[ch]pp

CI Configuration

Go to https://ci.appveyor.com/ add grant access to your repository. In the Security tab of GitHub, enable code scanning for code-ql (optional).

Acknowledgements

Credit where credit is due: this project was heavily inspired by https://www.github.com/cpp-gamedev/cpp-template.

About

Minimalistic C++ template using CMake as a build system.

Topics

Resources

License

Stars

Watchers

Forks