summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jimmi Holst Christensen2023-04-14 08:38:50 +0200
committerGravatar Jimmi Holst Christensen2023-04-14 08:38:50 +0200
commit7658c1a305dcca131eda2d8c823d1d86f59182a3 (patch)
tree1dc449adcc9de6c7625cd75d4d797683b7ab0bfd
parentCount occurrences of flags (was "Add .count type for flags") (#96) (diff)
downloadzig-clap-7658c1a305dcca131eda2d8c823d1d86f59182a3.tar.gz
zig-clap-7658c1a305dcca131eda2d8c823d1d86f59182a3.tar.xz
zig-clap-7658c1a305dcca131eda2d8c823d1d86f59182a3.zip
Update to newest version of zig
-rw-r--r--build.zig10
1 files changed, 6 insertions, 4 deletions
diff --git a/build.zig b/build.zig
index 59ae76d..e5a775d 100644
--- a/build.zig
+++ b/build.zig
@@ -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.");