diff options
| author | 2023-03-06 13:27:20 -0800 | |
|---|---|---|
| committer | 2023-03-06 23:26:33 +0100 | |
| commit | cb13519431b916c05c6c783cb0ce3b232be5e400 (patch) | |
| tree | 19b063907f2b993ecaf3c18b26acb1a48d12bbb0 | |
| parent | Mode addModule to the top (diff) | |
| download | zig-clap-cb13519431b916c05c6c783cb0ce3b232be5e400.tar.gz zig-clap-cb13519431b916c05c6c783cb0ce3b232be5e400.tar.xz zig-clap-cb13519431b916c05c6c783cb0ce3b232be5e400.zip | |
build: use new addModule() API which now returns a Module
| -rw-r--r-- | build.zig | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -1,7 +1,7 @@ | |||
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | 2 | ||
| 3 | pub fn build(b: *std.Build) void { | 3 | pub fn build(b: *std.Build) void { |
| 4 | b.addModule(.{ .name = "clap", .source_file = .{ .path = "clap.zig" } }); | 4 | const clap_mod = b.addModule("clap", .{ .source_file = .{ .path = "clap.zig" } }); |
| 5 | 5 | ||
| 6 | const optimize = b.standardOptimizeOption(.{}); | 6 | const optimize = b.standardOptimizeOption(.{}); |
| 7 | const target = b.standardTargetOptions(.{}); | 7 | const target = b.standardTargetOptions(.{}); |
| @@ -28,7 +28,7 @@ pub fn build(b: *std.Build) void { | |||
| 28 | .target = target, | 28 | .target = target, |
| 29 | .optimize = optimize, | 29 | .optimize = optimize, |
| 30 | }); | 30 | }); |
| 31 | example.addAnonymousModule("clap", .{ .source_file = .{ .path = "clap.zig" } }); | 31 | example.addModule("clap", clap_mod); |
| 32 | example.install(); | 32 | example.install(); |
| 33 | example_step.dependOn(&example.step); | 33 | example_step.dependOn(&example.step); |
| 34 | } | 34 | } |