This is an example C++ graphics application using vcpkg as its package manager; the codebase can be compiled for both native and Web platforms.
- Package Manager: vcpkg
- Supported Platforms: MacOSX, Web
# Clone the repository
git clone --recurse-submodules https://github.com/painfulexistence/cpp-wasm && cd cpp-wasm
# Bootstrapping the package manager
./vcpkg/bootstrap-vcpkg.sh
# Building
cmake -S . -B build # Add -DCMAKE_BUILD_TYPE=release for release build
cmake --build build
# Running
./build/main
# Building
cmake -S . -B build-wasm -DEMSCRIPTEN=ON # Add -DCMAKE_BUILD_TYPE=release for release build
cmake --build build-wasm
# Running (open http://localhost:3000/ in your browser)
python -m http.server -d ./build-wasm 3000 # Use your preferred local server
- I didn't use GLEW because the vcpkg wasm32 port is currently broken