diff options
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 10 |
1 files changed, 5 insertions, 5 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 | const clap_mod = b.addModule("clap", .{ .source_file = .{ .path = "clap.zig" } }); | 4 | const clap_mod = b.addModule("clap", .{ .root_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(.{}); |
| @@ -30,7 +30,7 @@ pub fn build(b: *std.Build) void { | |||
| 30 | .optimize = optimize, | 30 | .optimize = optimize, |
| 31 | }); | 31 | }); |
| 32 | const install_example = b.addInstallArtifact(example, .{}); | 32 | const install_example = b.addInstallArtifact(example, .{}); |
| 33 | example.addModule("clap", clap_mod); | 33 | example.root_module.addImport("clap", clap_mod); |
| 34 | example_step.dependOn(&example.step); | 34 | example_step.dependOn(&example.step); |
| 35 | example_step.dependOn(&install_example.step); | 35 | example_step.dependOn(&install_example.step); |
| 36 | } | 36 | } |
| @@ -57,13 +57,13 @@ pub fn build(b: *std.Build) void { | |||
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | fn readMeStep(b: *std.Build) *std.Build.Step { | 59 | fn readMeStep(b: *std.Build) *std.Build.Step { |
| 60 | const s = b.allocator.create(std.build.Step) catch unreachable; | 60 | const s = b.allocator.create(std.Build.Step) catch unreachable; |
| 61 | s.* = std.build.Step.init(.{ | 61 | s.* = std.Build.Step.init(.{ |
| 62 | .id = .custom, | 62 | .id = .custom, |
| 63 | .name = "ReadMeStep", | 63 | .name = "ReadMeStep", |
| 64 | .owner = b, | 64 | .owner = b, |
| 65 | .makeFn = struct { | 65 | .makeFn = struct { |
| 66 | fn make(step: *std.build.Step, _: *std.Progress.Node) anyerror!void { | 66 | fn make(step: *std.Build.Step, _: *std.Progress.Node) anyerror!void { |
| 67 | @setEvalBranchQuota(10000); | 67 | @setEvalBranchQuota(10000); |
| 68 | _ = step; | 68 | _ = step; |
| 69 | const file = try std.fs.cwd().createFile("README.md", .{}); | 69 | const file = try std.fs.cwd().createFile("README.md", .{}); |