-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathbuild.zig
More file actions
47 lines (40 loc) · 1.41 KB
/
Copy pathbuild.zig
File metadata and controls
47 lines (40 loc) · 1.41 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
const builtin = @import("builtin");
const std = @import("std");
const allocator = std.testing.allocator;
const freetype = @import("mach_freetype");
pub fn build(b: *std.Build) !void {
const optimize = b.standardOptimizeOption(.{});
const target = b.standardTargetOptions(.{});
const config = b.addOptions();
config.addOption(
[]const u8,
"home_path",
b.option([]const u8, "home-path", "") orelse "/home/jamie/",
);
config.addOption(
[]const u8,
"projects_file_path",
b.option([]const u8, "projects-file-path", "") orelse "/home/jamie/secret/projects",
);
const module = b.createModule(.{
.root_source_file = b.path("./focus.zig"),
.omit_frame_pointer = false,
.target = target,
.optimize = optimize,
.link_libc = true,
});
module.addOptions("focus_config", config);
module.addImport("mach-freetype", b.dependency("mach_freetype", .{}).module("mach-freetype"));
module.linkLibrary(b.dependency("glfw", .{}).artifact("glfw"));
module.linkSystemLibrary("GL", .{});
const exe = b.addExecutable(.{
.name = "focus-dev",
.root_module = module,
});
b.installArtifact(exe);
const exe_step = b.step("build", "Build");
exe_step.dependOn(&exe.step);
const run = b.addRunArtifact(exe);
const run_step = b.step("run", "Run");
run_step.dependOn(&run.step);
}