summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig3
1 files changed, 3 insertions, 0 deletions
diff --git a/build.zig b/build.zig
index ba92f3d..466f5d0 100644
--- a/build.zig
+++ b/build.zig
@@ -6,6 +6,7 @@ const Builder = std.build.Builder;
6 6
7pub fn build(b: *Builder) void { 7pub fn build(b: *Builder) void {
8 const mode = b.standardReleaseOptions(); 8 const mode = b.standardReleaseOptions();
9 const target = b.standardTargetOptions(.{});
9 10
10 const fmt_step = b.addFmt(&[_][]const u8{ 11 const fmt_step = b.addFmt(&[_][]const u8{
11 "build.zig", 12 "build.zig",
@@ -20,6 +21,7 @@ pub fn build(b: *Builder) void {
20 21
21 const tests = b.addTest("clap.zig"); 22 const tests = b.addTest("clap.zig");
22 tests.setBuildMode(test_mode); 23 tests.setBuildMode(test_mode);
24 tests.setTarget(target);
23 tests.setNamePrefix(mode_str ++ " "); 25 tests.setNamePrefix(mode_str ++ " ");
24 26
25 const test_step = b.step("test-" ++ mode_str, "Run all tests in " ++ mode_str ++ "."); 27 const test_step = b.step("test-" ++ mode_str, "Run all tests in " ++ mode_str ++ ".");
@@ -39,6 +41,7 @@ pub fn build(b: *Builder) void {
39 const example = b.addExecutable(example_name, "example/" ++ example_name ++ ".zig"); 41 const example = b.addExecutable(example_name, "example/" ++ example_name ++ ".zig");
40 example.addPackagePath("clap", "clap.zig"); 42 example.addPackagePath("clap", "clap.zig");
41 example.setBuildMode(mode); 43 example.setBuildMode(mode);
44 example.setTarget(target);
42 example.install(); 45 example.install();
43 example_step.dependOn(&example.step); 46 example_step.dependOn(&example.step);
44 } 47 }