-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.zig
More file actions
56 lines (46 loc) · 1.39 KB
/
build.zig
File metadata and controls
56 lines (46 loc) · 1.39 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const zigimg = b.dependency("zigimg", .{
.target = target,
.optimize = optimize,
});
const z2d = b.dependency("z2d", .{
.target = target,
.optimize = optimize,
});
const module = b.addModule("phantom", .{
.root_source_file = b.path("lib/phantom.zig"),
.target = target,
.optimize = optimize,
.imports = &.{
.{
.name = "zigimg",
.module = zigimg.module("zigimg"),
},
.{
.name = "z2d",
.module = z2d.module("z2d"),
},
},
});
const autodoc_test = b.addObject(.{
.name = "phantom",
.root_module = module,
});
const install_docs = b.addInstallDirectory(.{
.source_dir = autodoc_test.getEmittedDocs(),
.install_dir = .prefix,
.install_subdir = "doc/phantom",
});
b.getInstallStep().dependOn(&install_docs.step);
const step_test = b.step("test", "Run unit tests");
const test_exe = b.addTest(.{
.target = target,
.optimize = optimize,
.root_module = module,
});
const test_run = b.addRunArtifact(test_exe);
step_test.dependOn(&test_run.step);
}