Repository navigation
Expand file tree
/
Copy pathbuild.zig
More file actions
59 lines (49 loc) · 1.87 KB
/
Copy pathbuild.zig
File metadata and controls
59 lines (49 loc) · 1.87 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
57
58
59
const std = @import("std");
const Scanner = @import("wayland").Scanner;
pub fn build(b: *std.Build) void {
const optimize = b.standardOptimizeOption(.{});
const target = b.standardTargetOptions(.{});
const llvm = b.option(bool, "llvm", "Enables llvm and lld for compiling the executable");
const scanner = Scanner.create(b, .{});
const wayland = b.createModule(.{ .root_source_file = scanner.result });
scanner.addSystemProtocol("stable/xdg-shell/xdg-shell.xml");
scanner.generate("xdg_wm_base", 7);
scanner.generate("wl_compositor", 7);
scanner.generate("wl_shm", 3);
scanner.generate("wl_output", 4);
const mod = b.addModule("compositor", .{
.root_source_file = b.path("src/main.zig"),
.optimize = optimize,
.target = target,
.link_libc = true,
});
mod.linkSystemLibrary("wayland-server", .{});
mod.addImport("wayland", wayland);
const exe = b.addExecutable(.{
.name = "ignitewm",
.root_module = mod,
.use_lld = llvm,
.use_llvm = llvm,
});
b.installArtifact(exe);
const run_step = b.step("run", "Run ingite");
const run_compositor = b.addRunArtifact(exe);
run_step.dependOn(&run_compositor.step);
const client_exe = b.addExecutable(.{
.name = "client",
.root_module = b.addModule("client", .{
.root_source_file = b.path("client/main.zig"),
.optimize = optimize,
.link_libc = true,
.target = target,
}),
.use_lld = llvm,
.use_llvm = llvm,
});
client_exe.root_module.linkSystemLibrary("wayland-client", .{});
client_exe.root_module.addImport("wayland", wayland);
b.installArtifact(client_exe);
const run_client_step = b.step("client", "Run ingite");
const run_client = b.addRunArtifact(client_exe);
run_client_step.dependOn(&run_client.step);
}