Skip to content

Targets ​

Pre-defined target lists for cross-compilation.

Target Presets ​

all() ​

All OS + all architectures. 216 targets.

zig
buildx.targets.all()

OS: Windows, Linux, macOS, FreeBSD, NetBSD, OpenBSD, UEFI, WASI, Emscripten, iOS, tvOS, watchOS. Architectures: x86, x86_64, ARM, AArch64, RISC-V (32/64), MIPS (32/64), PowerPC (32/64), SPARC64, S390x, WASM (32/64), Hexagon, LoongArch64, Thumb.

desktop() ​

Desktop platforms only. 6 targets.

zig
buildx.targets.desktop()

Windows/Linux/macOS on x86_64 and aarch64.

linux() ​

Linux only. 16 targets.

zig
buildx.targets.linux()

x86, x86_64, ARM, AArch64, RISC-V (32/64), MIPS (32/64), PowerPC (32/64), SPARC64, S390x, LoongArch64.

windows() ​

Windows only. 4 targets.

zig
buildx.targets.windows()

x86, x86_64, ARM, AArch64.

macos() ​

macOS only. 2 targets.

zig
buildx.targets.macos()

x86_64 and aarch64 (Apple Silicon).

arm() ​

ARM architectures across all OS. 24 targets.

zig
buildx.targets.arm()

ARM and AArch64 across all supported OS.

riscv() ​

RISC-V architectures. 2 targets.

zig
buildx.targets.riscv()

RISC-V 32-bit and 64-bit on Linux.

freestanding() ​

No OS. 8 targets.

zig
buildx.targets.freestanding()

x86, x86_64, ARM, AArch64, RISC-V (32/64), WASM (32/64).

wasm() ​

WebAssembly. 2 targets.

zig
buildx.targets.wasm()

wasm32 and wasm64 on WASI.

allArchitectures() ​

All CPU architectures. 21 targets.

zig
buildx.targets.allArchitectures()

Custom Targets ​

Pass your own target queries:

zig
_ = buildx.project(b, .{
    .name = "myapp",
    .root = "src/main.zig",
    .cross = .{
        .targets = &.{
            .{ .cpu_arch = .x86_64, .os_tag = .linux },
            .{ .cpu_arch = .aarch64, .os_tag = .macos },
        },
    },
});

Available Architectures ​

ArchitectureDescription
x8632-bit x86
x86_6464-bit x86
arm32-bit ARM
aarch6464-bit ARM (ARMv8)
riscv3232-bit RISC-V
riscv6464-bit RISC-V
mips32-bit MIPS (big endian)
mipsel32-bit MIPS (little endian)
mips6464-bit MIPS (big endian)
mips64el64-bit MIPS (little endian)
powerpc32-bit PowerPC
powerpc6464-bit PowerPC (big endian)
powerpc64le64-bit PowerPC (little endian)
sparc6464-bit SPARC
s390xIBM System/390
wasm3232-bit WebAssembly
wasm6464-bit WebAssembly
hexagonQualcomm Hexagon
loongarch6464-bit LoongArch
thumbARM Thumb mode

Available OS Tags ​

OS TagDescription
windowsWindows
linuxLinux
macosmacOS
freebsdFreeBSD
netbsdNetBSD
openbsdOpenBSD
uefiUEFI firmware
wasiWebAssembly System Interface
emscriptenEmscripten
iosiOS
tvostvOS
watchoswatchOS
freestandingNo OS

Released under the MIT License.