Build System
build.zig is a Zig program, not a config file. These chapters show the four build modes and the trade-off of each mode. They also show how to cross-compile to any target with no toolchain to install, how to fetch dependencies through build.zig.zon, and how to make docs from doc comments.
- build.zig is a Zig program. If you want a conditional or a loop in your build, write one.
- A cross-compile installs nothing. The target is an argument, and the same command makes a binary for a machine that you do not own.
- The four build modes are a real choice. ReleaseSafe keeps the overflow and bounds checks. Those checks catch the bugs that this guide shows you many times.
6 chapters.
- Build ModesFour modes, and the cost and the benefit of each one.
- Emit an ExecutableHow to build without a build.zig.
- Cross-compilationAll targets are available when you install Zig.
- Zig BuildThe build system is a Zig program.
- DependenciesHow to declare, fetch and connect a package with build.zig.zon.
- Generate DocumentationDoc comments, and the site that Zig makes from them.