This is my JamTemplate for C++17. It will compile C++ code for native (Win, Linux) and web (webassembly) games .
Some games created with this JamTemplate are
- Burning Glyphs (Web, 7DFPS 2020)
- Tricky Tracktor (Native, FrankenGameJam 2021)
- Grounded (Native, FrankenGameJam 2020)
and some more at https://runvs.io/Games.
- go to ext folder and extract sfml-zip
- create build directory "build" parallel to src
- open command line (win+r "cmd")
- navigate to the just created build folder
- type
cmake ../
There should be no need for a 32 bit executable anymore. However if strictly required: Perform the steps from above except:
-
- Get the win32 zip from the sfml website
-
cmake -A Win32 ../
I run it with WSL, but every system capable of running wegassembly/emscripten should work.
emcmake cmake -DENABLE_WEB=ON ../
- on the first run
emmake make
(do not pass-j
, otherwise emscripten will get hickups with pulling libraries) - on consecutive runs:
emmake make -j
http-server .
to start a webserver locally.- open browser on
http://127.0.0.1:8080/
to test locally
For mac os you have to install cmake and sfml via homebrew: brew install cmake sfml
If you use another package manager or want to install the dependencies yourself, you have to modify the paths in CMakeLists.txt
.
All of those options can be set to ON or OFF via the cmake commandline
- ENABLE_UNITTESTS
- ENABLE_STRESSTEST
- ENABLE_WEB
e.g. calling cmake ../ -DENABLE_UNITTESTS=ON -DENABLE_STRESSTEST=ON
Code coverage helper command for future references:
OpenCppCoverage.exe --sources C:\projects\JamTemplateCpp\* --excluded_sources C:\projects\JamTemplateCpp\src\UnitTests\* --excluded_sources C:\projects\JamTemplateCpp\src\StressTest\* --excluded_sources C:\projects\JamTemplateCpp\ext\* -- build\Debug\UnitTests.exe