-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.zig
44 lines (35 loc) · 1.26 KB
/
build.zig
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const Build = @import("std").Build;
pub fn build(b: *Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const ansi_term = b.dependency("ansi-term", .{}).module("ansi-term");
const module = b.addModule("lscolors", .{
.root_source_file = b.path("src/main.zig"),
.imports = &.{
.{ .name = "ansi-term", .module = ansi_term },
},
});
const main_tests = b.addTest(.{
.name = "main test suite",
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
main_tests.root_module.addImport("ansi-term", ansi_term);
const run_main_tests = b.addRunArtifact(main_tests);
const test_step = b.step("test", "Run library tests");
test_step.dependOn(&run_main_tests.step);
const exe = b.addExecutable(.{
.name = "example",
.root_source_file = b.path("example.zig"),
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("lscolors", module);
const run_cmd = b.addRunArtifact(exe);
if (b.args) |args| {
run_cmd.addArgs(args);
}
const run_step = b.step("example", "Run the example");
run_step.dependOn(&run_cmd.step);
}