pub fn getCompileDependencies(start: *Compile, chase_dynamic: bool) []const *Compile start: *Compilechase_dynamic: bool751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777pub fn getCompileDependencies(start: *Compile, chase_dynamic: bool) []const *Compile {
const arena = start.step.owner.graph.arena;
var compiles: std.array_hash_map.Auto(*Compile, void) = .empty;
var next_idx: usize = 0;
compiles.putNoClobber(arena, start, {}) catch @panic("OOM");
while (next_idx < compiles.count()) {
const compile = compiles.keys()[next_idx];
next_idx += 1;
for (compile.root_module.getGraph().modules) |mod| {
for (mod.link_objects.items) |lo| {
switch (lo) {
.other_step => |other_compile| {
if (!chase_dynamic and other_compile.isDynamicLibrary()) continue;
compiles.put(arena, other_compile, {}) catch @panic("OOM");
},
else => {},
}
}
}
}
return compiles.keys();
}
Return the full set of
Step.Compilewhichstartdepends on, recursively.startitself is always returned as the first element. Ifchase_dynamicisfalse, then dynamic libraries are not included, and their dependencies are not considered; ifchase_dynamicistrue, dynamic libraries are treated the same as other linkedCompiles.