Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
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 standard library. Public Function

dependOnDirectory

Public Function
std.Build.dependOnDirectory
pub fn dependOnDirectory(b: *Build, lazy_path: LazyPath) void

Indicates that the build.zig logic depends on a particular directory's entries.

This is an alternative to Graph.poisonCache that avoids making every invocation of zig build into a cache miss.

If any file is created, deleted, or renamed in this directory, the configure phase will be repeated.

Only a subset of LazyPath are supported:

  • Relative to cwd
  • Relative to any package root
  • Relative to zig cache or zig installation

If the directory would be inside one of the search prefixes, then the dependency cannot be tracked; Graph.poisonCache must be used instead.

Params

File

Build.zig:2649
2649
2650
2651
2652
2653
2654
2655
2656
pub fn dependOnDirectory(b: *Build, lazy_path: LazyPath) void {
    validateConfigureDependency(lazy_path);
    const graph = b.graph;
    graph.configure_dependencies.append(graph.arena, .{
        .lazy_path = lazy_path.dupe(graph),
        .mode = .directory,
    }) catch @panic("OOM");
}