Spec M36 — multi-target builds (owner, 2026-09-03; last in the queue)

Goal: one mc build produces every configured output — macOS, Linux, Windows, wasm32, wasm64 — from one source tree and one mc.toml. Depends on the target registry (M17), the foreign targets (M16, M17, M19, M20, M33) and sysroot resolution (M25).

mc.toml #

[project]
name = "app"
entry = "main.mc"

[[targets]]              # each entry is a complete target; keys not given fall back to the
name = "mac"             # single-target sections ([target], [linker], [sysroot], [libs], [externs])
os = "macos"  arch = "aarch64"  kind = "exe"  out = "build/app-macos-arm64"

[[targets]]
name = "linux"
os = "linux"  arch = "aarch64"  out = "build/app-linux-arm64"
linker.cmd = "ld.lld"    # dotted keys override the shared [linker] for this target only

[[targets]]
name = "web"
os = "browser"  arch = "wasm32"  out = "build/app.wasm"

Acceptance #

examples/minimal and examples/wasm gain [[targets]] covering every available target on the machine; mc build produces all outputs; --list-targets is deterministic; CI runs the macOS and wasm entries and the Linux entry through the two-stage job; docs/guide/50-cross-compile.md documents the section.

Edit this page