diff options
| author | 2023-04-14 08:38:50 +0200 | |
|---|---|---|
| committer | 2023-04-14 08:38:50 +0200 | |
| commit | 7658c1a305dcca131eda2d8c823d1d86f59182a3 (patch) | |
| tree | 1dc449adcc9de6c7625cd75d4d797683b7ab0bfd /build.zig | |
| parent | Count occurrences of flags (was "Add .count type for flags") (#96) (diff) | |
| download | zig-clap-7658c1a305dcca131eda2d8c823d1d86f59182a3.tar.gz zig-clap-7658c1a305dcca131eda2d8c823d1d86f59182a3.tar.xz zig-clap-7658c1a305dcca131eda2d8c823d1d86f59182a3.zip | |
Update to newest version of zig
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 10 |
1 files changed, 6 insertions, 4 deletions
| @@ -12,10 +12,11 @@ pub fn build(b: *std.Build) void { | |||
| 12 | .target = target, | 12 | .target = target, |
| 13 | .optimize = optimize, | 13 | .optimize = optimize, |
| 14 | }); | 14 | }); |
| 15 | test_step.dependOn(&tests.run().step); | 15 | const run_tests = b.addRunArtifact(tests); |
| 16 | test_step.dependOn(&run_tests.step); | ||
| 16 | 17 | ||
| 17 | const example_step = b.step("examples", "Build examples"); | 18 | const example_step = b.step("examples", "Build examples"); |
| 18 | inline for (.{ | 19 | for ([_][]const u8{ |
| 19 | "simple", | 20 | "simple", |
| 20 | "simple-ex", | 21 | "simple-ex", |
| 21 | "streaming-clap", | 22 | "streaming-clap", |
| @@ -24,13 +25,14 @@ pub fn build(b: *std.Build) void { | |||
| 24 | }) |example_name| { | 25 | }) |example_name| { |
| 25 | const example = b.addExecutable(.{ | 26 | const example = b.addExecutable(.{ |
| 26 | .name = example_name, | 27 | .name = example_name, |
| 27 | .root_source_file = .{ .path = "example/" ++ example_name ++ ".zig" }, | 28 | .root_source_file = .{ .path = b.fmt("example/{s}.zig", .{example_name}) }, |
| 28 | .target = target, | 29 | .target = target, |
| 29 | .optimize = optimize, | 30 | .optimize = optimize, |
| 30 | }); | 31 | }); |
| 32 | const install_example = b.addInstallArtifact(example); | ||
| 31 | example.addModule("clap", clap_mod); | 33 | example.addModule("clap", clap_mod); |
| 32 | example.install(); | ||
| 33 | example_step.dependOn(&example.step); | 34 | example_step.dependOn(&example.step); |
| 35 | example_step.dependOn(&install_example.step); | ||
| 34 | } | 36 | } |
| 35 | 37 | ||
| 36 | const readme_step = b.step("readme", "Remake README."); | 38 | const readme_step = b.step("readme", "Remake README."); |