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 › Serialize › createModuleDependenciesForStep Private Function createModuleDependenciesForStep Doc Source Private Function std.Build.Serialize.createModuleDependenciesForStep
fn createModuleDependenciesForStep (step : *Step ) Allocator .Error !void Params File Build/Serialize.zig: 1293
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339 fn createModuleDependenciesForStep (step : *Step ) Allocator .Error !void {
const root_module = if (step .cast (Step .Compile )) |cs | root : {
break :root cs .root_module ;
} else return ; // not a compile step so no module dependencies
// Starting from `root_module`, discover all modules in this graph.
const modules = root_module .getGraph ().modules ;
// For each of those modules, set up the implied step dependencies.
for (modules ) |mod | {
if (mod .root_source_file ) |lp | lp .addStepDependencies (step );
for (mod .include_dirs .items ) |include_dir | switch (include_dir ) {
.path ,
.path_system ,
.path_after ,
.framework_path ,
.framework_path_system ,
.embed_path ,
=> |lp | lp .addStepDependencies (step ),
.other_step => |other | {
other .getEmittedIncludeTree ().addStepDependencies (step );
step .dependOn (&other .step );
},
.config_header_step => |other | step .dependOn (&other .step ),
};
for (mod .lib_paths .items ) |lp | lp .addStepDependencies (step );
for (mod .rpaths .items ) |rpath | switch (rpath ) {
.lazy_path => |lp | lp .addStepDependencies (step ),
.special => {},
};
for (mod .link_objects .items ) |link_object | switch (link_object ) {
.static_path ,
.assembly_file ,
=> |lp | lp .addStepDependencies (step ),
.other_step => |other | step .dependOn (&other .step ),
.system_lib => {},
.c_source_file => |source | source .file .addStepDependencies (step ),
.c_source_files => |source_files | source_files .root .addStepDependencies (step ),
.win32_resource_file => |rc_source | {
rc_source .file .addStepDependencies (step );
for (rc_source .include_paths ) |lp | lp .addStepDependencies (step );
},
};
}
}
If the given
Stepis aStep.Compile, adds any dependencies for that step which are implied by the module graph rooted atstep.cast(Step.Compile).?.root_module.