diff options
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 3 |
1 files changed, 3 insertions, 0 deletions
| @@ -6,6 +6,7 @@ const Builder = std.build.Builder; | |||
| 6 | 6 | ||
| 7 | pub fn build(b: *Builder) void { | 7 | pub 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 | } |