- Install CMake
- Install Visual Studio
- Make sure to include CMake support as part of the installation
- Install vcpkg
- Using vcpkg, install project dependencies:
vcpkg install sdl2:x64-windows sdl2-image:x64-windows sdl2-mixer:x64-windows sdl2-ttf:x64-windows
- Download this repo, open it up in Visual Studio, and build it
- Optional: install the compiled binaries: Build > Install ...
- Optional: create a zip of the compiled binaries:
cpack -G ZIP --config build-x64-Release/CPackConfig.cmake
(Tested on: Arch Linux, WSL w/ Ubuntu 22.04 LTS)
- Install development dependencies: cmake, make, git
- Install project dependencies
- On Arch Linux, these are: sdl2, sdl2_image, sdl2_ttf, sdl2_mixer
- On Ubuntu 22.04 LTS, these are: libsdl2-dev, libsdl2-image-dev, libsdl2-ttf-dev, libsdl2-mixer-dev
- Download this repository and navigate to its location in a terminal
- Be sure to
git clone --recursive
orgit submodule update --init
in order to use https://github.com/aminosbh/sdl2-cmake-modules
- Be sure to
- Generate build directory:
cmake -B build
- Compile and link:
cmake --build build
- Run game:
build/MyGame
(Tested on Linux)
- Install development dependencies: cmake, make, git, python3
- Install Emscripten
- Download this repository and navigate to its location in a terminal
- Generate build directory:
emcmake cmake -B build/
- Compile and link:
emmake cmake --build build/
- Note: there is a good chance this will fail with something like
fatal error: 'SDL2/SDL.h' file not found
because some of the required ports haven't been built and for some reason Emscripten doesn't automatically build them when invoked from CMake. Explicitly build the ports first:embuilder build sdl2 sdl2_image sdl2_mixer sdl2_ttf
- Note: there is a good chance this will fail with something like
cd build
- Run a local server:
python3 -m http.server
- Visit the served page in your browser e.g.
http://localhost:8000
- Optional: install the compiled binaries:
cmake --install build/
- Optional: create a zip of the compiled binaries:
cpack -G ZIP --config build/CPackConfig.cmake