Demonstrates a the build process of a simple & portable raylib application for Desktop / Web.
- (Static) assets passed via
--preload-file
for Web - Dynamic files using IDBFS (browser storage)
git clone https://github.com/manuel5975p/raylib-cmake-template.git
cd raylib-cmake-template
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug #Can also be =Release, =RelWithDebInfo, nothing defaults to Debug
make -j4
./main
Requires emscripten.
mkdir build_web && cd build_web
emcmake cmake .. -DCMAKE_BUILD_TYPE=Release -DPLATFORM=Web
make -j4
- Open the
raylib-cmake-template
directory in VSCode - Make sure the "C/C++" extension as well "CMake Tools" are installed
- Also have a compiler installed (e.g. the latest w64devkit)
- Hit the debug, build button or hit Ctrl+Shift+P for the command menu and run "CMake: Debug" or something similar