summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jimmi Holst Christensen2024-05-16 09:39:54 +0200
committerGravatar Jimmi Holst Christensen2024-05-16 09:39:54 +0200
commit7a2883c7b884ab3e88c9fbf29193894a844da4d5 (patch)
treecfacaddad82e7e5eb2ce268c7c07a423b38ba373
parentUpdated `build.zig` to support Zig 0.13.0-dev.211+6a65561e3 (diff)
downloadzig-clap-7a2883c7b884ab3e88c9fbf29193894a844da4d5.tar.gz
zig-clap-7a2883c7b884ab3e88c9fbf29193894a844da4d5.tar.xz
zig-clap-7a2883c7b884ab3e88c9fbf29193894a844da4d5.zip
Use b.path instead of manually setting the fields
-rw-r--r--build.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/build.zig b/build.zig
index b4b1789..afdcece 100644
--- a/build.zig
+++ b/build.zig
@@ -1,14 +1,14 @@
1const std = @import("std"); 1const std = @import("std");
2 2
3pub fn build(b: *std.Build) void { 3pub fn build(b: *std.Build) void {
4 const clap_mod = b.addModule("clap", .{ .root_source_file = .{ .src_path = .{ .owner = b, .sub_path = "clap.zig" } } }); 4 const clap_mod = b.addModule("clap", .{ .root_source_file = b.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(.{});
8 8
9 const test_step = b.step("test", "Run all tests in all modes."); 9 const test_step = b.step("test", "Run all tests in all modes.");
10 const tests = b.addTest(.{ 10 const tests = b.addTest(.{
11 .root_source_file = .{ .src_path = .{ .owner = b, .sub_path = "clap.zig" } }, 11 .root_source_file = b.path("clap.zig"),
12 .target = target, 12 .target = target,
13 .optimize = optimize, 13 .optimize = optimize,
14 }); 14 });
@@ -25,7 +25,7 @@ pub fn build(b: *std.Build) void {
25 }) |example_name| { 25 }) |example_name| {
26 const example = b.addExecutable(.{ 26 const example = b.addExecutable(.{
27 .name = example_name, 27 .name = example_name,
28 .root_source_file = .{ .src_path = .{ .owner = b, .sub_path = b.fmt("example/{s}.zig", .{example_name}) } }, 28 .root_source_file = b.path(b.fmt("example/{s}.zig", .{example_name})),
29 .target = target, 29 .target = target,
30 .optimize = optimize, 30 .optimize = optimize,
31 }); 31 });