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 standard library.
std › Build › Step › ObjCopy › create Public Function create Doc Source 59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84 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 ;
}