diff options
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 12 |
1 files changed, 8 insertions, 4 deletions
| @@ -24,12 +24,16 @@ pub fn build(b: *std.Build) void { | |||
| 24 | }) |example_name| { | 24 | }) |example_name| { |
| 25 | const example = b.addExecutable(.{ | 25 | const example = b.addExecutable(.{ |
| 26 | .name = example_name, | 26 | .name = example_name, |
| 27 | .root_source_file = b.path(b.fmt("example/{s}.zig", .{example_name})), | 27 | .root_module = b.createModule(.{ |
| 28 | .target = target, | 28 | .root_source_file = b.path(b.fmt("example/{s}.zig", .{example_name})), |
| 29 | .optimize = optimize, | 29 | .target = target, |
| 30 | .optimize = optimize, | ||
| 31 | .imports = &.{ | ||
| 32 | .{ .name = "clap", .module = clap_mod }, | ||
| 33 | }, | ||
| 34 | }), | ||
| 30 | }); | 35 | }); |
| 31 | const install_example = b.addInstallArtifact(example, .{}); | 36 | const install_example = b.addInstallArtifact(example, .{}); |
| 32 | example.root_module.addImport("clap", clap_mod); | ||
| 33 | example_step.dependOn(&example.step); | 37 | example_step.dependOn(&example.step); |
| 34 | example_step.dependOn(&install_example.step); | 38 | example_step.dependOn(&install_example.step); |
| 35 | } | 39 | } |