Skip to content

Latest commit

 

History

History
75 lines (65 loc) · 2.94 KB

BUILD.md

File metadata and controls

75 lines (65 loc) · 2.94 KB

How to build Otto Matic

The easy way: build.py (automated build script)

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.

How to build the game manually on macOS

  1. Install the prerequisites:
    • Xcode (preferably the latest version)
    • CMake 3.21+ (installing via Homebrew is recommended)
  2. Clone the repo recursively:
    git clone --recurse-submodules https://github.com/jorio/OttoMatic
    cd OttoMatic
    
  3. 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.
  4. Prep the Xcode project:
    cmake -G Xcode -S . -B build
    
  5. Now you can open build/OttoMatic.xcodeproj in Xcode, or you can just go ahead and build the game:
    cmake --build build --config RelWithDebInfo
    
  6. The game gets built in build/RelWithDebInfo/OttoMatic.app. Enjoy!

How to build the game manually on Windows

  1. Install the prerequisites:
    • Visual Studio 2022 with the C++ toolchain
    • CMake 3.21+
  2. Clone the repo recursively:
    git clone --recurse-submodules https://github.com/jorio/OttoMatic
    cd OttoMatic
    
  3. 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.
  4. Prep the Visual Studio solution:
    cmake -G "Visual Studio 17 2022" -A x64 -S . -B build
    
  5. 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
    
  6. The game gets built in build/Release/OttoMatic.exe. Enjoy!

How to build the game manually on Linux et al.

  1. 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)
  2. Clone the repo recursively:
    git clone --recurse-submodules https://github.com/jorio/OttoMatic
    cd OttoMatic
    
  3. Build the game:
    cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
    cmake --build build
    
    If you'd like to enable runtime sanitizers, append -DSANITIZE=1 to the first cmake call above.
  4. The game gets built in build/OttoMatic. Enjoy!