From 7658c1a305dcca131eda2d8c823d1d86f59182a3 Mon Sep 17 00:00:00 2001 From: Jimmi Holst Christensen Date: Fri, 14 Apr 2023 08:38:50 +0200 Subject: Update to newest version of zig --- build.zig | 10 ++++++---- 1 file 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 { .target = target, .optimize = optimize, }); - test_step.dependOn(&tests.run().step); + const run_tests = b.addRunArtifact(tests); + test_step.dependOn(&run_tests.step); const example_step = b.step("examples", "Build examples"); - inline for (.{ + for ([_][]const u8{ "simple", "simple-ex", "streaming-clap", @@ -24,13 +25,14 @@ pub fn build(b: *std.Build) void { }) |example_name| { const example = b.addExecutable(.{ .name = example_name, - .root_source_file = .{ .path = "example/" ++ example_name ++ ".zig" }, + .root_source_file = .{ .path = b.fmt("example/{s}.zig", .{example_name}) }, .target = target, .optimize = optimize, }); + const install_example = b.addInstallArtifact(example); example.addModule("clap", clap_mod); - example.install(); example_step.dependOn(&example.step); + example_step.dependOn(&install_example.step); } const readme_step = b.step("readme", "Remake README."); -- cgit v1.2.3