build.py
can produce a game executable from a fresh clone of the repo in a single command. It will work on macOS, Windows and Linux, provided that your system has Python 3, CMake, and an adequate C++ compiler.
git clone --recurse-submodules https://github.com/jorio/OttoMatic
cd OttoMatic
python3 build.py
If you want to build the game manually instead, the rest of this document describes how to do just that on each of the big 3 desktop operating systems.
- Install the prerequisites:
- Xcode (preferably the latest version)
- CMake 3.21+ (installing via Homebrew is recommended)
- Clone the repo recursively:
git clone --recurse-submodules https://github.com/jorio/OttoMatic cd OttoMatic
- Download SDL3-3.2.4.dmg, open it, then browse to SDL3.xcframework/macos-arm64_x86_64. In that folder, copy SDL3.framework to the game's extern folder.
- Prep the Xcode project:
cmake -G Xcode -S . -B build
- Now you can open
build/OttoMatic.xcodeproj
in Xcode, or you can just go ahead and build the game:cmake --build build --config RelWithDebInfo
- The game gets built in
build/RelWithDebInfo/OttoMatic.app
. Enjoy!
- Install the prerequisites:
- Visual Studio 2022 with the C++ toolchain
- CMake 3.21+
- Clone the repo recursively:
git clone --recurse-submodules https://github.com/jorio/OttoMatic cd OttoMatic
- Download SDL3-devel-3.2.4-VC.zip, extract it, and copy SDL3-3.2.4 to the extern folder. Rename SDL3-3.2.4 to just SDL3.
- Prep the Visual Studio solution:
cmake -G "Visual Studio 17 2022" -A x64 -S . -B build
- Now you can open
build/OttoMatic.sln
in Visual Studio, or you can just go ahead and build the game:cmake --build build --config Release
- The game gets built in
build/Release/OttoMatic.exe
. Enjoy!
- Install the prerequisites from your package manager:
- Any C++20 compiler
- CMake 3.21+
- SDL3 development library (e.g. "libsdl3-dev" on Ubuntu, "sdl3" on Arch, "SDL3-devel" on Fedora)
- OpenGL development libraries (e.g. "libgl1-mesa-dev" on Ubuntu)
- Clone the repo recursively:
git clone --recurse-submodules https://github.com/jorio/OttoMatic cd OttoMatic
- Build the game:
If you'd like to enable runtime sanitizers, append
cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo cmake --build build
-DSANITIZE=1
to the firstcmake
call above. - The game gets built in
build/OttoMatic
. Enjoy!