-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.zig
More file actions
25 lines (20 loc) · 802 Bytes
/
build.zig
File metadata and controls
25 lines (20 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const zaft = b.addModule("zaft", .{
.root_source_file = b.path("src/main.zig"),
});
const test_filter = b.option([]const u8, "test-filter", "Skip tests that do not match any filter");
const test_exe = b.addTest(.{
.name = "zaft-test",
.root_source_file = b.path("test/main.zig"),
.target = target,
.optimize = optimize,
.filters = if (test_filter) |f| &.{f} else &.{},
});
test_exe.root_module.addImport("zaft", zaft);
const test_run = b.addRunArtifact(test_exe);
const test_step = b.step("test", "Run tests");
test_step.dependOn(&test_run.step);
}