Skip to content

Examples

All examples are in the examples/ directory and build successfully.

Available Examples

ExampleDescriptionKey Features
basic-executableMinimal executableinstall = true
library-with-testsLibrary with test suitekind = .library, tests = true
cross-compileMulti-platform buildcross field, targets.all()
custom-optionsBuild-time optionsboolOption, stringOption
system-libLink C librariessystem_libs field
run-with-argsRun step with argumentsrun = true
monorepoMulti-package workspaceworkspace(), local_deps

Running Examples

bash
cd examples/basic-executable
zig build

Using buildx as a Dependency

Each example's build.zig.zon references buildx.zig:

zig
.dependencies = .{
    .buildx = .{
        .path = "../..",
    },
},

Released under the MIT License.