Posts Tagged ‘Toolchains’

Cross-compiling for Steam Deck from Apple Silicon Mac

Monday, July 15th, 2024

Most of the development of my game has been happening on my M2 MacBook Air. One of the main places I’d like to play the game, though, is on my Steam Deck. In order to play the game on my Steam Deck, I need to compile it for the Steam Deck. There’s a number of ways I could do this, but I wanted a solution that would let me compile on my Mac directly with minimal infrastructure fuss (no VMs, network access, user mode emulation, etc).

SteamOS SDK

Poking around, games can run in one of a number of runtimes, each with a standardized set of libraries available. We’ll be going with the latest, “sniper”. You can find information about it on Valve’s web site.

The file we’re interested in is the developer sysroot (latest version as of writing). This has all the libraries that would be needed at runtime, plus all the header files, library symlinks, static archives, and other files we’d need for development. It also contains a compiler ready for use, except that the compiler is compiled for x86_64, while we’re on AArch64, so we can’t run the compiler directly. Also, it’s compiled for Linux, but we’re on macOS.

(more…)