pub fn dependency(b: *Build, name: []const u8, args: anytype) *Dependency b: *Buildname: []const u8args2019
2020
2021
2022
2023
2024
2025
2026pub fn dependency(b: *Build, name: []const u8, args: anytype) *Dependency {
return dependencyLazy(b, name, args) catch |err| switch (err) {
error.LazyDependencyNeeded => {
assert(b.graph.needed_lazy_dependencies.count() != 0);
serializeConfigurationExiting(b);
},
};
}
Declares that the current configuration does in fact require a potentially lazy dependency.
If the dependency is already fetched, it is returned. Otherwise, exits the configuration phase with intent to fetch the lazy dependency and rerun the configuration script.
If it is known to the caller at this point that additional lazy dependencies are also required, it would save time to call
dependencyLazyinstead, handlingerror.LazyDependencyNeededin a way that marks multiple potentially lazy dependencies as required before eventually returning that error from the top level build function.