-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.zig
36 lines (31 loc) · 1.17 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
const std = @import("std");
pub fn build(b: *std.Build) void {
const optimize = b.standardOptimizeOption(.{});
const target = b.standardTargetOptions(.{});
const strip = b.option(bool, "strip", "Omit debug symbols") orelse false;
const aniz = b.addExecutable(.{
.name = "aniz",
.root_source_file = b.path("src/aniz.zig"),
.target = target,
.optimize = optimize,
.strip = strip,
.single_threaded = true,
});
b.installArtifact(aniz);
const test_step = b.step("test", "Run all tests in all modes.");
const tests = b.addTest(.{
.root_source_file = b.path("src/aniz.zig"),
.target = target,
.optimize = optimize,
.strip = strip,
.single_threaded = true,
});
const run_tests = b.addRunArtifact(tests);
test_step.dependOn(&run_tests.step);
const datetime = b.dependency("datetime", .{});
const folders = b.dependency("folders", .{});
for ([_]*std.Build.Step.Compile{ aniz, tests }) |comp| {
comp.root_module.addImport("datetime", datetime.module("zig-datetime"));
comp.root_module.addImport("folders", folders.module("known-folders"));
}
}