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.

create

ObjCopy.create
pub fn create(owner: *std.Build, input_file: std.Build.LazyPath, options: Options) *ObjCopy

File

lib/std/Build/Step/ObjCopy.zig:59

Code

pub fn create(owner: *std.Build, input_file: std.Build.LazyPath, options: Options) *ObjCopy {
    const graph = owner.graph;
    const wc = &graph.wip_configuration;
    const oc = graph.create(ObjCopy);
    oc.* = .{
        .step = .init(.{
            .tag = base_tag,
            .name = owner.fmt("objcopy {f}", .{input_file}),
            .owner = owner,
        }),
        .input_file = input_file,
        .basename = if (options.basename) |s| .init(wc.addString(s) catch @panic("OOM")) else .none,
        .output_file = graph.addGeneratedFile(&oc.step),
        .debug_file = if (options.separate_debug_file) |df| .{
            .basename = if (df.basename) |s| .init(wc.addString(s) catch @panic("OOM")) else .none,
            .output_file = graph.addGeneratedFile(&oc.step),
        } else null,
        .format = options.format,
        .only_section = if (options.only_section) |s| .init(wc.addString(s) catch @panic("OOM")) else .none,
        .pad_to = options.pad_to,
        .strip = options.strip,
        .compress_debug = options.compress_debug,
    };
    input_file.addStepDependencies(&oc.step);
    return oc;
}