Skip to the content.

generate command

zigmod generate

For a full reference on the fields available in deps.zig you can check here.

Adding deps.zig to your build.zig

 const std = @import("std");
+const deps = @import("./deps.zig");
 
 pub fn build(b: *std.build.Builder) void {
     const target = b.standardTargetOptions(.{});
 
     const mode = b.standardReleaseOptions();
 
     const exe = b.addExecutable("hello", "src/main.zig");
     exe.setTarget(target);
     exe.setBuildMode(mode);
+    deps.addAllTo(exe);
     exe.install();

If you don’t want Zigmod to handle adding packages to your project and only do resource fetching then deps.fetch(exe) may be called independently of deps.addAllTo(exe).

deps.addAllTo(exe) will call deps.fetch(exe) inside of it, so as to be compatible with deps.zig generated by zigmod fetch.