Build System
build.zig is a Zig program, not a config file. These chapters cover the four build modes and what each trades, cross-compiling to any target without a toolchain to install, fetching dependencies through build.zig.zon, and generating docs from doc comments.
- build.zig is a Zig program. When you want a conditional or a loop in your build, you write one.
- Cross-compiling installs nothing. The target is an argument, and the same command produces a binary for a machine you do not own.
- The four build modes are a real choice. ReleaseSafe keeps the overflow and bounds checks that catch the bugs this guide keeps showing you.
6 chapters.
- Build ModesFour modes, and what each one trades.
- Emitting an ExecutableBuilding without a build.zig.
- Cross-compilationEvery target, out of the box.
- Zig BuildThe build system is a Zig program.
- DependenciesDeclaring, fetching, and wiring a package with build.zig.zon.
- Generating DocumentationDoc comments and the generated site.