zig build

Build project from build.zig

Subcommands

NameDescription
installCopy build artifacts to prefix path
uninstallRemove build artifacts from prefix path
runRun the app
testRun unit tests

Options

NameDescription
-p, --prefix <path>Override default install prefix
--prefix-lib-dir <path>Override default library directory path
--prefix-exe-dir <path>Override default executable directory path
--prefix-include-dir <path>Override default include directory path
--sysroot <path>Set the system root directory (usually /)
--search-prefix <path>Add a path to look for binaries, libraries, headers
--libc <path>Provide a file which specifies libc paths
-fdarlingIntegration with system-installed Darling to execute macOS programs on Linux hosts
-fno-fdarlingNo integration with system-installed Darling to execute macOS programs on Linux hosts
-fqemuIntegration with system-installed QEMU to execute foreign-architecture programs on Linux host
-fno-qemuNo integration with system-installed QEMU to execute foreign-architecture programs on Linux host
--glibc-runtimes <path>Enhances QEMU integration by providing glibc built for multiple foreign architectures
-frosettaRely on Rosetta to execute x86_64 programs on ARM64 macOS hosts
-fno-rosettaDon't rely on Rosetta to execute x86_64 programs on ARM64 macOS hosts
-fwasmtimeIntegration with system-installed wasmtime to execute WASI binaries
-fno-wasmtimeNo integration with system-installed wasmtime to execute WASI binaries
-fwineIntegration with system-installed Wine to execute Windows programs on Linux hosts
-fno-wineNo integration with system-installed Wine to execute Windows programs on Linux hosts
-h, --helpPrint help and exit
--verbosePrint commands before executing them
--color <arg>Enable or disable colored message
--prominent-compile-errorsOutput compile errors formatted for a human to read
-DtargetThe CPU architecture, OS, and ABI to build for
-DcpuTarget CPU features to add or subtract
-Drelease-safe <arg>Optimizations on and safety on
-Drelease-fast <arg>Optimizations on and safety off
-Drelease-small <arg>Size optimizations on and safety off
-fstage1Force using bootstrap compiler as the codegen backend
-fno-stage1Prevent using bootstrap compiler as the codegen backend
-freference-traceHow many lines of reference trace should be shown per compile error
-fno-reference-traceDisable reference trace
--build-file <arg>Override path to build.zig
--cache-dir <arg>Override path to local Zig cache directory
--global-cache-dir <arg>Override path to global Zig cache directory
--zig-lib-dir <arg>Override path to Zig lib directory
--verbose-linkEnable compiler debug output for linking
--verbose-airEnable compiler debug output for Zig AIR
--verbose-llvm-irEnable compiler debug output for LLVM IR
--verbose-cimportEnable compiler debug output for C imports
--verbose-ccEnable compiler debug output for C compilation
--verbose-llvm-cpu-featuresEnable compiler debug output for LLVM CPU features