-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.zig
More file actions
42 lines (33 loc) · 1.2 KB
/
build.zig
File metadata and controls
42 lines (33 loc) · 1.2 KB
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
const std = @import("std");
// runner.
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const lamcal = b.createModule(
.{ .source_file = .{ .path = "src/modules/lamcal.zig" } },
);
const main_tests = b.addTest(.{
.root_source_file = .{ .path = "src/modules/lamcal.zig" },
.target = target,
.optimize = optimize,
});
const run_main_tests = b.addRunArtifact(main_tests);
const test_step = b.step("test", "Run library tests");
test_step.dependOn(&run_main_tests.step);
// add executable
const get_type = b.addExecutable(.{
.name = "get-type",
.root_source_file = .{ .path = "src/exe/get_type.zig" },
.target = target,
.optimize = optimize,
});
get_type.addModule("lamcal", lamcal);
b.installArtifact(get_type);
const run_get_type_cmd = b.addRunArtifact(get_type);
run_get_type_cmd.step.dependOn(b.getInstallStep());
if (b.args) |args| {
run_get_type_cmd.addArgs(args);
}
const run_get_type_step = b.step("get-type", "Run \"get type\" tool");
run_get_type_step.dependOn(&run_get_type_cmd.step);
}