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

addSystemCommand

Public Function
std.Build.addSystemCommand
pub fn addSystemCommand(b: *Build, argv: []const []const u8) *Step.Run

Creates a step that executes a process on the host system.

argv is one or more command line arguments passed to the executed process. The first element is the name of the executable to run. More command line arguments can be added with methods of Step.Run, such as:

  • Step.Run.addArgs
  • Step.Run.addArtifactArg
  • Step.Run.addFileArg
  • Step.Run.addOutputFileArg

This function introduces a system dependency, compromising reproducibility and making it more difficult to set up one's computer in order to build the project from source.

See also:

Params

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

File

Build.zig:741
741
742
743
744
745
746
pub fn addSystemCommand(b: *Build, argv: []const []const u8) *Step.Run {
    assert(argv.len >= 1);
    const run_step = Step.Run.create(b, b.fmt("run {s}", .{argv[0]}));
    run_step.addArgs(argv);
    return run_step;
}