Implemented Xorg initialization code
This commit is contained in:
parent
f894fb317d
commit
097a6a9b5c
11 changed files with 96 additions and 29 deletions
20
build.zig
20
build.zig
|
|
@ -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(.{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue