The purpose of this project is to create a very basic minimal CMake project able to compile C++ program using emscripten with the following features enabled:
- Linking to external C++ library crosscompiled to JS file
- Using bindings created via Embind
- Preloading assets files
- Sample OpenGL stack to get going
See the WebAssembly setup to get all the requirements.
What you will need
- Python 2.7
- C++ Compiler
- CMake
- Emscripten
Start by cloning this repository, making sure to pass the --recursive
flag to grab all the dependencies. If you forgot, then you can git submodule update --init
instead.
- Setup project
./setup.sh
- this will build and compile the libraries - Build project
./build.sh
- this will build the project - See output in
dist/index.html
Note: there is no wasm loader at this time, see example output or modify output from client.js
to client.html
You can also view the example by unzipping example.zip
.
Functionality | Library |
---|---|
Mesh Loading | assimp |
Physics | bullet |
OpenGL Function Loader | glad |
Windowing and Input | glfw |
OpenGL Mathematics | glm |
Texture Loading | stb |
- CMake Conversion
- Embind
- Passing Emscripten Arguments
- Support uploading files
- Provide example WASM output
- WASM Output (requires loader file)
- Sample Vendor Compiling
- Sample Vendor Runtime
- Select OpenGL libraries
- Script to build LLVM libraries
- Sample JavaScript Application
- Convert bash scripts in CMake (I suck at CMake)
- JavaScript Loader
- Select Architecture
- Document Architecture
- C++ Unit Testing Setup with Google Test
- Platform to support Web & Native