Implemented Xorg initialization code

This commit is contained in:
Lorenzo Torres 2025-08-04 02:46:36 +02:00
parent f894fb317d
commit 097a6a9b5c
11 changed files with 96 additions and 29 deletions

View file

@ -51,13 +51,27 @@ pub fn build(b: *std.Build) void {
}),
});
exe.root_module.addImport("sideros", sideros);
exe.root_module.addCSourceFile(.{ .file = b.path("ext/xdg-shell.c") });
exe.root_module.addIncludePath(b.path("ext"));
sideros.addIncludePath(b.path("ext"));
exe.linkSystemLibrary("vulkan");
exe.linkSystemLibrary("wayland-client");
exe.linkLibC();
const options = b.addOptions();
if (target.result.os.tag == .linux) {
const wayland = b.option(bool, "wayland", "Use Wayland to create the main window") orelse false;
if (wayland) {
exe.linkSystemLibrary("wayland-client");
exe.root_module.addCSourceFile(.{ .file = b.path("ext/xdg-shell.c") });
} else {
exe.linkSystemLibrary("xcb");
exe.linkSystemLibrary("xcb-icccm");
}
options.addOption(bool, "wayland", wayland);
}
sideros.addOptions("config", options);
b.installArtifact(exe);
const root_lib = b.addLibrary(.{