Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

addWatchInput

Places a file dependency on the path.

Step.addWatchInput
pub fn addWatchInput(step: *Step, maker: *Maker, arena: Allocator, lazy_file: LazyPath) Allocator.Error!void

File

Code

pub fn addWatchInput(step: *Step, maker: *Maker, arena: Allocator, lazy_file: LazyPath) Allocator.Error!void {
    const conf = &maker.scanned_config.configuration;
    switch (lazy_file) {
        .source_path => |source_path| {
            const sub_path = source_path.sub_path.slice(conf);
            const pkg_path = try maker.packagePath(arena, source_path.owner, sub_path);
            try addWatchInputPath(step, maker, pkg_path);
        },
        .relative => |relative| {
            const resolved_path = try maker.relativePath(arena, relative);
            try addWatchInputPath(step, maker, resolved_path);
        },
        // Nothing to watch because this dependency edge is modeled instead via `dependants`.
        .generated => {},
    }
}