This commit is contained in:
Harrison DiAmbrosio 2025-10-23 23:30:54 -04:00
commit 17cdbae175
12 changed files with 341 additions and 10 deletions

View file

@ -1,4 +1,5 @@
const std = @import("std");
const builtin = @import("builtin");
const Scanner = @import("wayland").Scanner;
@ -6,6 +7,13 @@ pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
// TODO: this will probably change based on the install paths, make this a var
// that can be passed at comptime?
const runtime_path_prefix = switch (builtin.mode) {
.Debug => "runtime/",
else => "/usr/share",
};
// If instead your goal is to create an executable, consider if users might
// be interested in also being able to embed the core functionality of your
// program in their own executable in order to avoid the overhead involved in
@ -33,6 +41,7 @@ pub fn build(b: *std.Build) void {
const xkbcommon = b.dependency("xkbcommon", .{}).module("xkbcommon");
const pixman = b.dependency("pixman", .{}).module("pixman");
const wlroots = b.dependency("wlroots", .{}).module("wlroots");
const zlua = b.dependency("zlua", .{}).module("zlua");
wlroots.addImport("wayland", wayland);
wlroots.addImport("xkbcommon", xkbcommon);
@ -55,11 +64,16 @@ pub fn build(b: *std.Build) void {
mez.root_module.addImport("wayland", wayland);
mez.root_module.addImport("xkbcommon", xkbcommon);
mez.root_module.addImport("wlroots", wlroots);
mez.root_module.addImport("zlua", zlua);
mez.linkSystemLibrary("wayland-server");
mez.linkSystemLibrary("xkbcommon");
mez.linkSystemLibrary("pixman-1");
const options = b.addOptions();
options.addOption([]const u8, "runtime_path_prefix", runtime_path_prefix);
mez.root_module.addOptions("config", options);
b.installArtifact(mez);
const run_step = b.step("run", "Run the app");