stevee

My wayland statusbar
git clone git://gtms.dev/stevee
Log | Files | Refs | README | LICENSE

build.zig (1083B)


      1 const std = @import("std");
      2 const Build = std.Build;
      3 
      4 const Scanner = @import("wayland").Scanner;
      5 
      6 pub fn build(b: *Build) !void {
      7     const target = b.standardTargetOptions(.{});
      8     const optimize = b.standardOptimizeOption(.{});
      9 
     10     const scanner = Scanner.create(b, .{});
     11 
     12     const wayland = b.createModule(.{ .root_source_file = scanner.result });
     13 
     14     scanner.addSystemProtocol("stable/xdg-shell/xdg-shell.xml");
     15 
     16     // Pass the maximum version implemented by your wayland server or client.
     17     // Requests, events, enums, etc. from newer versions will not be generated,
     18     // ensuring forwards compatibility with newer protocol xml.
     19     scanner.generate("wl_compositor", 1);
     20     scanner.generate("wl_shm", 1);
     21     scanner.generate("xdg_wm_base", 1);
     22 
     23     const exe = b.addExecutable(.{
     24         .name = "hello",
     25         .root_source_file = b.path("hello.zig"),
     26         .target = target,
     27         .optimize = optimize,
     28     });
     29 
     30     exe.root_module.addImport("wayland", wayland);
     31     exe.linkLibC();
     32     exe.linkSystemLibrary("wayland-client");
     33 
     34     b.installArtifact(exe);
     35 }