Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Building

Prerequisites

macOS (development)

brew install sdl2 sdl2_ttf

Linux (Debian/Ubuntu)

sudo apt install libsdl2-dev libsdl2-ttf-dev

Build commands

# Native macOS build
just native

# Run locally
just run

# Cross-compile for RG35XXSP via Docker
just docker-aarch64

# Create release zip
just package

# Run tests
just test

# Check (fast type-check)
just check

Build profiles

Release

[profile.release]
opt-level = 3
lto = true
strip = true
panic = "abort"
  • lto = true: Link-time optimization reduces binary size
  • strip = true: Remove debug symbols
  • panic = "abort": Smaller binary, no unwinding

Typical release binary: ~500 KB

Development

[profile.dev]
opt-level = 1

Fast compilation for iteration.

Cross-compilation details

The Docker image (scripts/Dockerfile.build) is based on Ubuntu 20.04 for glibc compatibility. It builds:

  • SDL2 2.26.2 from source (avoids macOS Metal symbol issues)
  • SDL2_ttf 2.20.2 from source (includes bundled FreeType/HarfBuzz)
  • Rust stable via rustup

Native Linux approach

Requires aarch64-linux-gnu-gcc toolchain and aarch64 SDL2 libraries:

sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
sudo apt install libsdl2-dev:arm64 libsdl2-ttf-dev:arm64

The scripts/build-aarch64.sh script detects macOS and refuses to run (since macOS SDL2 libs are incompatible).