0PricingLogin
Zig Academy · Lesson

Anatomy of a build.zig File

The build function and the Builder.

A Build Script in Zig

Your project's build is not a config file in another language. It is a real Zig program named build.zig that you can read and debug. 🏗️

It Starts with build

Every build.zig exposes one entry point: a public build function. Zig calls it to discover what your project should produce.

pub fn build(b: *std.Build) void {
    _ = b;
}

All lessons in this course

  1. Anatomy of a build.zig File
  2. Declaring Executables and Libraries
  3. Build Steps and zig build run
  4. Build Options and Flags
← Back to Zig Academy