feature. See also
. The project being documented here (as the example) is the Zig library itself.
Compile.getCompileDependencies
pub fn getCompileDependencies(
arena: Allocator,
module_graph: *ModuleGraph,
conf: *const Configuration,
start: Configuration.Step.Index,
chase_dynamic: bool,
) ![]const Configuration.Step.Index
File
Code
pub fn getCompileDependencies(
arena: Allocator,
module_graph: *ModuleGraph,
conf: *const Configuration,
start: Configuration.Step.Index,
chase_dynamic: bool,
) ![]const Configuration.Step.Index {
var compiles: std.array_hash_map.Auto(Configuration.Step.Index, void) = .empty;
var compiles_i: usize = 0;
try compiles.putNoClobber(arena, start, {});
while (compiles_i < compiles.count()) : (compiles_i += 1) {
const step = compiles.keys()[compiles_i].ptr(conf);
const compile = step.extended.get(conf.extra).compile;
const modules = try getModuleList(arena, module_graph, compile.root_module, conf);
for (modules.keys()) |mod_index| {
const mod = mod_index.get(conf);
for (0..mod.link_objects.len) |i| {
switch (mod.link_objects.get(conf.extra, i)) {
.other_step => |other_compile_index| {
const other_compile = other_compile_index.ptr(conf).extended.get(conf.extra).compile;
if (!chase_dynamic and other_compile.isDynamicLibrary()) continue;
try compiles.put(arena, other_compile_index, {});
},
else => {},
}
}
}
}
return compiles.keys();
}