Git Product home page Git Product logo

emscripten-cpp-cmake-template's Introduction

MyLib MyApp codecov GitHub license Website ricardoheath.co.uk/emscripten-cpp-cmake-template/

emscripten-cpp-cmake-template

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 cppcheck and clang-tidy
  • Dynamic Analysis using Address Sanitizer, Leak Sanitizer, Thread Sanitizer, and Undefined Behaviour Sanitizer
  • Unit tests ran using Valgrind for runtime memory analysis
  • Caching builds via ccache
  • Caching CMake dependencies via CPM
  • Multi-project (Monorepo) setup, with MyLib for e.g. a game engine, and MyApp for 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.