const std = @import("std"); const Scanner = @import("zig-wayland").Scanner; pub fn build(b: *std.Build) void { const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{}); const scanner = Scanner.create(b, .{}); scanner.addSystemProtocol("stable/xdg-shell/xdg-shell.xml"); scanner.addSystemProtocol("staging/fractional-scale/fractional-scale-v1.xml"); scanner.generate("wl_compositor", 6); scanner.generate("wl_shm", 1); scanner.generate("wl_output", 4); scanner.generate("xdg_wm_base", 2); scanner.generate("wp_fractional_scale_manager_v1", 1); const wayland = b.createModule(.{ .root_source_file = scanner.result }); const exe = b.addExecutable(.{ .name = "zigway", .root_source_file = b.path("src/main.zig"), .target = target, .optimize = optimize, }); exe.root_module.addImport("wayland", wayland); exe.linkLibC(); exe.linkSystemLibrary("wayland-client"); exe.linkSystemLibrary("pangocairo"); scanner.addCSource(exe); b.installArtifact(exe); const run_cmd = b.addRunArtifact(exe); run_cmd.step.dependOn(b.getInstallStep()); if (b.args) |args| { run_cmd.addArgs(args); } const run_step = b.step("run", "Run the app"); run_step.dependOn(&run_cmd.step); }