- Configure build (build.zig's build fn is invoked)
- If
lazyDependency
is ever called during configuration, exit the build runner and resolve the missing dependencies and rebuild/rexecute
Example Usage:
const foo_enabled = b.option(bool, "foo", "Enable foo stuff") orelse false;
if (foo_enabled) {
if (b.lazyDependency("foo", .{})) |foo_dep| {
exe.linkLibrary(foo_dep.artifact("foo"));
}
}
- Configure build (build.zig's build fn is invoked)
- during configuration,
lazyDependency
returns a dependency object that yeilds paths/artifacts that are "poisoned" with the original lazy dependency
- during configuration,
- After configuration, take the set of steps being built and traverse the build graph to find all steps that we are intending to build and that have been poisoned by a lazy dependency that is missing
- If any missing dependencies are found, do what we do today, exit the build runner and resolve the missing dependencies and rebuild/rexecute
Example usage:
const foo_dep = b.lazyDependency("foo", .{});
// foo_dep.artifact("foo") is "poisoned" with a lazy dependency
exe.linkLibrary(foo_dep.artifact("foo"));
This idea requires updating build.zig
to track and associate artifacts/paths with dependencies...it's not clear to me how feasible this is.