# Platforms

> Every target the framework builds, how a game chooses its own in [targets], and what CI does with each one — on every push, and on a release.

Source: https://omardev29.github.io/rmp-docs/manual/platforms/index.html

One codebase builds for 17 targets: Linux x86-64, Linux ARM64, Linux RISC-V, Linux x86-64 (musl / Alpine), Windows x86-64, Windows ARM64, macOS (universal), iOS (simulator), Web (WebAssembly), Android, FreeBSD x86-64, FreeBSD ARM64, OpenBSD x86-64, OpenBSD ARM64, NetBSD x86-64, Linux DRM/KMS (no X11), Linux ARM64 DRM/KMS (no X11). A game chooses which of them it ships in one place, `[targets]` in `raylib_multiplatform.toml`, and everything downstream — the build files, CI, the release — follows that choice.

The code of a game does not change from one target to another. What changes is how the game is built, packaged and run, and the pages in this section are about those differences:

- [Desktop](https://omardev29.github.io/rmp-docs/manual/platforms/desktop.html) — Windows, macOS, Linux (glibc, musl, DRM/KMS, RISC-V) and the BSDs.
- [Linux from a console](https://omardev29.github.io/rmp-docs/manual/platforms/linux-console.html) — on a machine with no desktop, `rmp` builds for DRM/KMS by itself: the screen and the keyboard from `/dev`, sudo or the groups, and the terminal it gives back.
- [Web](https://omardev29.github.io/rmp-docs/manual/platforms/web.html) — Emscripten, a browser that owns the frame loop, memory, saves and sound.
- [Android](https://omardev29.github.io/rmp-docs/manual/platforms/android.html) — raymob, Gradle generated from the `.toml`, permissions, signing.
- [iOS](https://omardev29.github.io/rmp-docs/manual/platforms/ios.html) — Xcode through XcodeGen, the raylib-iOS fork, and an app that is not allowed to quit.

## Every target

| Target | What it is | Family | Groups it is in |
|---|---|---|---|
| `linux-x64-glibc` | Linux x86-64 | linux | `all`, `desktop`, `linux` |
| `linux-arm64-glibc` | Linux ARM64 | linux | `all`, `desktop`, `linux` |
| `linux-riscv64-glibc` | Linux RISC-V | linux | `all`, `desktop`, `linux` |
| `linux-x64-musl` | Linux x86-64 (musl / Alpine) | linux | `all`, `linux` |
| `windows-x64` | Windows x86-64 | windows | `all`, `desktop`, `windows` |
| `windows-arm64` | Windows ARM64 | windows | `all`, `desktop`, `windows` |
| `macos` | macOS (universal) | apple | `all`, `apple`, `desktop` |
| `ios` | iOS (simulator) | apple | `all`, `apple`, `mobile` |
| `web` | Web (WebAssembly) | web | `all`, `web` |
| `android` | Android | android | `all`, `android`, `mobile` |
| `freebsd-x64` | FreeBSD x86-64 | bsd | `all`, `bsd` |
| `freebsd-arm64` | FreeBSD ARM64 | bsd | `all`, `bsd` |
| `openbsd-x64` | OpenBSD x86-64 | bsd | `all`, `bsd` |
| `openbsd-arm64` | OpenBSD ARM64 | bsd | `all`, `bsd` |
| `netbsd-x64` | NetBSD x86-64 | bsd | `all`, `bsd` |
| `linux-x64-glibc-drm` | Linux DRM/KMS (no X11) | linux | `all`, `drm`, `linux` |
| `linux-arm64-glibc-drm` | Linux ARM64 DRM/KMS (no X11) | linux | `all`, `drm`, `linux` |

A target's name is `<os>-<arch>-<libc>-<env>`, and each part is only there when it can differ. `linux-x64-glibc` and `linux-x64-musl` name their C library because a glibc binary does not start on Alpine and a musl binary does not start on Debian; `windows-x64` stops after the architecture because Windows has one C library; `macos` stops at the operating system because its binary carries both architectures. The last part, the environment, is the windowing system, and it is only written when the binary is limited to one: `linux-x64-glibc-drm` draws through DRM/KMS, with no X11 and no Wayland.

### Families

Each target belongs to one of 6 families, and the family is which part of CI builds it: `linux`, `windows`, `apple`, `web`, `android` and `bsd`. CI skips a whole family when none of its targets are enabled, so a game that ships only to desktops never starts an Android build.

## Choosing a game's targets

`[targets]` has two lists. `enabled` names targets and groups; `disabled` is subtracted from whatever `enabled` came to. Groups expand and duplicates fold together, so there is no order to think about and nothing to conflict:

```toml
[targets]
enabled = ["all"]
disabled = ["ios"]
```

That is everything but iOS. The same lists take exact target names, and mix them with groups:

```toml
[targets]
enabled = ["desktop", "web", "linux-x64-musl"]
disabled = ["windows-arm64"]
```

The groups:

| Group | Holds |
|---|---|
| `all` | Every target. |
| `desktop` | Linux glibc on x86-64, ARM64 and RISC-V; Windows on x86-64 and ARM64; macOS. Not musl, not the DRM targets and not the BSDs. |
| `linux` | Every Linux target: the glibc ones, musl and the DRM ones. |
| `windows` | Windows on x86-64 and ARM64. |
| `apple` | macOS and iOS. |
| `mobile` | Android and iOS. |
| `bsd` | FreeBSD, OpenBSD and NetBSD, on every architecture built for them. |
| `drm` | The Linux DRM/KMS targets. |
| `web`, `android` | The one target each. |

The table above says which groups each target is in. A name that is neither a target nor a group is refused, and so is a pair of lists that leaves nothing to build. So is the most natural typo of all — a group name without the brackets of a list:

```toml
[targets]
enabled = "all"
```

```text
  raylib_multiplatform.toml:2: enabled = "all"
                               ^^^^^^^^^^^^^^^

  configure: error: [targets] enabled = 'all' is a string, and this has to be a list.
                    Write [targets] enabled = ['all'] -- with the brackets. Without them TOML hands over the characters one at a time.
                    Groups count as names here: ["all"], ["desktop"].
```

Turning a target off removes it from the build, from CI and from the release. Other settings follow it: `[android.admob]` switches itself off when Android is not a target, and a non-empty `[raylib] disabled_modules` warns when iOS is one, because iOS links a prebuilt raylib that it cannot reach.

## What CI does with each target

CI runs in two lanes. A push or a pull request gets the **fast lane**: the targets that catch most mistakes, in about ten minutes. A tag — a release — gets the **full lane**: every target the game has enabled, and then the release itself. The full lane can also be started by hand, for every target or for the groups and targets you list, separated by commas:

```shell
gh workflow run ci.yml -f full=true        # every enabled target
gh workflow run ci.yml -f targets=drm      # one group or target; implies the full lane
gh workflow run ci.yml -f targets=linux-x64-glibc,windows-x64,macos
```

Building is not the bar. Wherever CI can start a desktop build, the game is started with a frame budget: it must report that it booted with every asset loaded — `assets_failed=0`, where a file asked for through `rmp::assets` that is missing or does not decode counts — a frame is read back and must have something drawn on it, and it must print that it reached the end of the budget. The web build has no frame budget: it is opened in headless Chromium, must report the same boot line, and its canvas is measured for pixels. A desktop release is started from a folder with no `resources/` in it, the way a player starts it from a file manager, and has to find the one next to it — on every system but OpenBSD and NetBSD, which cannot say where an executable is.

| Target | Lane | What CI checks |
|---|---|---|
| `linux-x64-glibc` | every push | Built; checked against the `[linux] glibc` floor and for how it was linked; resources packed; booted under a virtual X server, with a frame read back; the archive unzipped and started from another folder, compressed by UPX by default. |
| `web` | every push | Built; booted in headless Chromium, the canvas measured for pixels, and a save written to IndexedDB and read back. |
| `windows-x64` | every push | Built with the runner's MinGW GCC; its imports checked to be all part of Windows 10; booted on the Windows runner from another folder, with the compiler off `PATH` and a software OpenGL placed next to the executable, a frame read back, and a save made in a user folder whose name is not ASCII. |
| `android` | every push | A debug APK built and checked; a release AAB built, signed and its signature verified. Not run, except by the optional Firebase Test Lab job, which runs in the full lane and skips with a warning unless a Firebase project and its key are set up: its Robo test taps through the debug APK, which shows only Google's test ads. |
| `linux-arm64-glibc` | full | Built on an ARM64 runner, checked against the glibc floor, booted under a virtual X server; the archive unzipped and started from another folder, compressed by UPX by default. |
| `linux-x64-musl` | full | Built; checked to be a musl binary with no glibc symbol, asking the system for musl's loader and C library and nothing else; on Alpine, a software-rendered build of it booted, and the archive's binary, compressed by UPX by default, started under a virtual X server. |
| `linux-riscv64-glibc` | full | Cross-compiled and checked to be a RISC-V executable; checked against its own glibc floor, 2.38, which `[linux] glibc` does not set. The archive is unzipped and started from another folder on a RISC-V board when `[ci] riscv64` names one, and under QEMU's emulation of RISC-V when it does not or the board fails, under a virtual X server. Not compressed unless named in `[upx]`. |
| `linux-x64-glibc-drm` | full | Built; checked to link libdrm and no X11 or Wayland; the archive's binary, compressed by UPX by default, booted on a virtual display the kernel provides. On the same display, `rmp run` run the way a [Linux console](https://omardev29.github.io/rmp-docs/manual/platforms/linux-console.html) runs it, which has to decide DRM/KMS by itself, build, check `/dev` and boot the game. |
| `linux-arm64-glibc-drm` | full | Built and checked the same way. Not run: what it is for is a Raspberry Pi's own display pipeline, which a virtual display does not resemble. |
| `windows-arm64` | full | Cross-compiled with MSVC and checked to be an ARM64 executable whose imports are all part of Windows 10. Never run. |
| `macos` | full | Built as one binary with both architectures, and checked for both and for the oldest macOS each asks for; a software-rendered build booted, and a software-rendered release started from the project folder it was built in and from another folder. |
| `ios` | full | raylib built for iOS, the Xcode project generated, a simulator app built and its bundle checked. Booted in the simulator only when the repository variable `IOS_SIMULATOR_TEST` is `true`. |
| the BSDs | full | Built in a virtual machine of each system; checked to be an executable; resources packed; a software-rendered build booted inside the machine, and a software-rendered release started from the project folder it was built in and then from another folder — from its own on OpenBSD and NetBSD, which cannot say where an executable is. |

Every release binary is also held to its size, once a game has written its sizes down — see [the size budget](https://omardev29.github.io/rmp-docs/publishing/ci.html#size-budget). Every push also runs the checks that need no target: the `.toml`, the pinned versions, the licences, and one frame of the game drawn by raylib's software renderer — most of what `rmp test` runs on your machine.

A push to a branch cancels a CI run already going on that branch, so a second push can kill a long full-lane run halfway. `rmp push` refuses while a run is in flight and names it; `rmp push force` pushes anyway.

What becomes of the builds — the release, its archives, the stores — is the subject of [Publishing](https://omardev29.github.io/rmp-docs/publishing/index.html).
