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

addSearchPrefix

Public Function
std.Build.addSearchPrefix
pub fn addSearchPrefix(b: *Build, search_prefix: []const u8) void

Adds additional paths, equivalent to the --search-prefix arguments provided by the user. Paths added with this function have lower precedence than the ones specified by the user on the command line.

It is generally best practice to avoid calling this function, instead relying on the user to provide these paths via the standard build system interface. However, when integrating with other build systems, the user may have already provided the information to the other build system, and thus it is desirable to use that same information without requiring the user to provide it again.

Params

  • b: *Build
  • search_prefix: []const u8

File

Build.zig:1841
1841
1842
1843
1844
1845
1846
1847
1848
pub fn addSearchPrefix(b: *Build, search_prefix: []const u8) void {
    if (b.isRoot()) {
        const graph = b.graph;
        const wc = &graph.wip_configuration;
        const string = wc.addString(search_prefix) catch @panic("OOM");
        wc.search_prefixes.append(wc.gpa, string) catch @panic("OOM");
    }
}