-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.zig
27 lines (22 loc) · 923 Bytes
/
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
const std = @import("std");
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const dep_opts = .{ .target = target, .optimize = optimize };
const metrics_module = b.dependency("metrics", dep_opts).module("metrics");
_ = b.addModule("logz", .{
.root_source_file = b.path("src/logz.zig"),
.imports = &.{.{ .name = "metrics", .module = metrics_module }},
});
const lib_test = b.addTest(.{
.root_source_file = b.path("src/logz.zig"),
.target = target,
.optimize = optimize,
.test_runner = b.path("test_runner.zig"),
});
lib_test.root_module.addImport("metrics", metrics_module);
const run_test = b.addRunArtifact(lib_test);
run_test.has_side_effects = true;
const test_step = b.step("test", "Run tests");
test_step.dependOn(&run_test.step);
}