-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.zig
57 lines (44 loc) · 1.79 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
const std = @import("std");
const assets_dir = "assets/";
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const exe = b.addExecutable(.{
.name = "gravitas",
.root_source_file = b.path("src/main.zig"),
.optimize = optimize,
.target = target,
});
// Add the assets directory to the include path
const install_content_step = b.addInstallDirectory(.{
.source_dir = b.path(assets_dir),
.install_dir = .{ .custom = "" },
.install_subdir = "bin/" ++ assets_dir,
});
exe.step.dependOn(&install_content_step.step);
@import("system_sdk").addLibraryPathsTo(exe);
@import("zgpu").addLibraryPathsTo(exe);
const zgpu = b.dependency("zgpu", .{});
exe.root_module.addImport("zgpu", zgpu.module("root"));
exe.linkLibrary(zgpu.artifact("zdawn"));
const zglfw = b.dependency("zglfw", .{});
exe.root_module.addImport("zglfw", zglfw.module("root"));
exe.linkLibrary(zglfw.artifact("glfw"));
const zgui = b.dependency("zgui", .{
.target = target,
.backend = .glfw_wgpu,
});
exe.root_module.addImport("zgui", zgui.module("root"));
exe.linkLibrary(zgui.artifact("imgui"));
const zmath = b.dependency("zmath", .{});
exe.root_module.addImport("zmath", zmath.module("root"));
const zjobs = b.dependency("zjobs", .{});
exe.root_module.addImport("zjobs", zjobs.module("root"));
const zflecs = b.dependency("zflecs", .{});
exe.root_module.addImport("zflecs", zflecs.module("root"));
exe.linkLibrary(zflecs.artifact("flecs"));
const run_cmd = b.addRunArtifact(exe);
const run_step = b.step("run", "Run gravitas");
run_step.dependOn(&run_cmd.step);
b.installArtifact(exe);
}