const std = @import("std"); const Scanner = @import("wayland").Scanner; pub fn build(b: *std.Build) void { const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{}); // Wayland const scanner = Scanner.create(b, .{}); const wayland = b.createModule(.{ .root_source_file = scanner.result }); scanner.addSystemProtocol("stable/xdg-shell/xdg-shell.xml"); scanner.addSystemProtocol("unstable/xdg-decoration/xdg-decoration-unstable-v1.xml"); scanner.generate("wl_compositor", 1); scanner.generate("wl_shm", 1); scanner.generate("xdg_wm_base", 1); scanner.generate("zxdg_decoration_manager_v1", 1); const z2d = b.dependency("z2d", .{}).module("z2d"); const exe = b.addExecutable(.{ .name = "gui", .root_module = b.createModule(.{ .root_source_file = b.path("src/main.zig"), .target = target, .optimize = optimize, .imports = &.{ .{ .name = "wayland", .module = wayland }, .{ .name = "z2d", .module = z2d }, }, }), }); exe.linkLibC(); exe.linkSystemLibrary("wayland-client"); b.installArtifact(exe); const run_step = b.step("run", "Run the app"); const run_cmd = b.addRunArtifact(exe); run_step.dependOn(&run_cmd.step); run_cmd.step.dependOn(b.getInstallStep()); if (b.args) |args| { run_cmd.addArgs(args); } const exe_tests = b.addTest(.{ .root_module = exe.root_module, }); const run_exe_tests = b.addRunArtifact(exe_tests); const test_step = b.step("test", "Run tests"); test_step.dependOn(&run_exe_tests.step); }