-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.zig
37 lines (31 loc) · 1.4 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
const std = @import("std");
const Phantom = @import("phantom");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const display_backend = b.option(Phantom.DisplayBackendType, "display-backend", "The display backend to use for the example") orelse .headless;
const scene_backend = b.option(Phantom.SceneBackendType, "scene-backend", "The scene backend to use for the example") orelse .headless;
const phantom = b.dependency("phantom", .{
.target = target,
.optimize = optimize,
});
const vizops = b.dependency("vizops", .{
.target = target,
.optimize = optimize,
});
const options = b.addOptions();
options.addOption(Phantom.DisplayBackendType, "display_backend", display_backend);
options.addOption(Phantom.SceneBackendType, "scene_backend", scene_backend);
const exe_compositor = b.addExecutable(.{
.name = "compositor",
.root_source_file = .{
.path = b.pathFromRoot("src/compositor.zig"),
},
.target = target,
.optimize = optimize,
});
exe_compositor.root_module.addImport("phantom", phantom.module("phantom"));
exe_compositor.root_module.addImport("vizops", vizops.module("vizops"));
exe_compositor.root_module.addImport("options", options.createModule());
b.installArtifact(exe_compositor);
}