A template for using emscripten with C++20 and CMake, and using GLAD and SDL2
- Emscripten web build, deployed to
gh-pages. View demo here - Linux, Mac, and Windows native builds via
Github Actions - Code coverage via
CodeCov - Code formatting via
clang-format - Static Analysis using
cppcheckandclang-tidy - Dynamic Analysis using
Address Sanitizer,Leak Sanitizer,Thread Sanitizer, andUndefined Behaviour Sanitizer - Unit tests ran using
Valgrindfor runtime memory analysis - Caching builds via
ccache - Caching CMake dependencies via CPM
- Multi-project (Monorepo) setup, with
MyLibfor e.g. a game engine, andMyAppfor e.g the gameplay code - Unit tests via Doctest
- Benchmarks via Google Benchmark
- Strict compiler warnings due to cmake/CompilerWarnings, taken from cpp_starter_project
- No third-party warnings due to cmake/SetSystemIncludes and cmake/CompilerWarnings
- Building SDL2 from source
Note: glad and KHR were generated from cmake/FetchGLAD. Unfortunately the GLAD generator doesn't seem to generate gles2 properly when ran on the Github Actions runners, so it was generated locally and commited to the repo instead.
main.cpp of MyApp is from this Gist by SuperV1234, with changes based on static analysis and formatting, and small tweaks to get GLAD and SDL running with gles2 in native builds.