-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.zig
59 lines (44 loc) · 2 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
58
59
const std = @import("std");
const gobject_build = @import("gobject");
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const build_options = b.addOptions();
build_options.addOption([]const u8, "locale_dir", b.getInstallPath(.{ .custom = "share/locale" }, ""));
const sqlite_dep = b.dependency("sqlite", .{ .SQLITE_ENABLE_RTREE = true });
const sqlite = sqlite_dep.module("sqlite");
const edgelist = b.addExecutable(.{
.name = "edgelist",
.root_source_file = b.path("./edgelist/main.zig"),
.target = target,
.optimize = optimize,
});
edgelist.root_module.addImport("sqlite", sqlite);
b.installArtifact(edgelist);
const edgelist_artifact = b.addRunArtifact(edgelist);
const edgelist_step = b.step("run-edgelist", "Run edgelist");
edgelist_step.dependOn(&edgelist_artifact.step);
const exe = b.addExecutable(.{
.name = "andromeda",
.root_source_file = b.path("./src/main.zig"),
.target = target,
.optimize = optimize,
});
exe.linkLibC();
exe.root_module.addOptions("build_options", build_options);
// exe.root_module.linkFramework("OpenGL", .{});
exe.root_module.linkSystemLibrary("epoxy", .{});
exe.root_module.addImport("sqlite", sqlite);
const gobject = b.dependency("gobject", .{});
const libintl = b.dependency("libintl", .{});
exe.root_module.addImport("glib", gobject.module("glib2"));
exe.root_module.addImport("gobject", gobject.module("gobject2"));
exe.root_module.addImport("gio", gobject.module("gio2"));
exe.root_module.addImport("gdk", gobject.module("gdk4"));
exe.root_module.addImport("gtk", gobject.module("gtk4"));
exe.root_module.addImport("libintl", libintl.module("libintl"));
b.installArtifact(exe);
const run_artifact = b.addRunArtifact(exe);
const run_step = b.step("run", "Run the application");
run_step.dependOn(&run_artifact.step);
}