zig_compile

Description

Compiles a Zig source program to a native executable or shared library using the bundled Zig 0.16.0 compiler.

Overview

Compiles a Zig program using the bundled Zig 0.16.0 compiler. Produces a self-contained native binary with no runtime dependencies. Supports cross-compilation: you can compile Windows targets from a Linux server and vice versa.

Parameters

Name Type Description
Code string The Zig source code to compile.
OS ZigOS Target operating system (Windows or Linux). Default: Windows.
Architecture ZigArchitecture Target architecture (x86, x86_64, aarch64). Default: x86_64.
Optimization ZigOptimization Optimization mode (Debug, ReleaseSafe, ReleaseFast, ReleaseSmall). Default: ReleaseSmall.
OutputType ZigOutputType Output type (Exe or Lib). Default: Exe.
Subsystem ZigSubsystem Windows PE subsystem (Console or Windows). Console shows a terminal window; Windows suppresses it. Only applies to Windows EXE targets. Default: Console.

Example Output

A compiled native binary as a byte array, suitable for further pipeline processing or direct delivery.

Scroll to Top