ziglang/zig

use case: fetch lazy dependency when running a step

EzequielRamis opened this issue · 0 comments

I came across this user's problem with a "hacky" solution now that lazyDependency exists, but it would be nice to have something more elegant.

const test_step = b.step("test", "Run all unit tests");

var lazy_dep: ?*std.Build.Dependency = null;
var args = try std.process.args();
while (args.next()) |a| {
    if (std.mem.eql(u8, a, "test")) lazy_dep = b.lazyDependency("foo", .{});
}