build: scan river-status protocol
This commit is contained in:
parent
a6e6e47af9
commit
fcea0863f2
1 changed files with 37 additions and 19 deletions
44
build.zig
44
build.zig
|
@ -110,6 +110,19 @@ const ScanProtocolsStep = struct {
|
||||||
&[_][]const u8{ protocol_dir, "stable/xdg-shell/xdg-shell.xml" },
|
&[_][]const u8{ protocol_dir, "stable/xdg-shell/xdg-shell.xml" },
|
||||||
&[_][]const u8{ "protocol", "wlr-layer-shell-unstable-v1.xml" },
|
&[_][]const u8{ "protocol", "wlr-layer-shell-unstable-v1.xml" },
|
||||||
&[_][]const u8{ "protocol", "river-control-unstable-v1.xml" },
|
&[_][]const u8{ "protocol", "river-control-unstable-v1.xml" },
|
||||||
|
&[_][]const u8{ "protocol", "river-status-unstable-v1.xml" },
|
||||||
|
};
|
||||||
|
|
||||||
|
const server_protocols = [_][]const u8{
|
||||||
|
"xdg-shell",
|
||||||
|
"wlr-layer-shell-unstable-v1",
|
||||||
|
"river-control-unstable-v1",
|
||||||
|
"river-status-unstable-v1",
|
||||||
|
};
|
||||||
|
|
||||||
|
const client_protocols = [_][]const u8{
|
||||||
|
"river-control-unstable-v1",
|
||||||
|
"river-status-unstable-v1",
|
||||||
};
|
};
|
||||||
|
|
||||||
for (protocol_dir_paths) |dir_path| {
|
for (protocol_dir_paths) |dir_path| {
|
||||||
|
@ -119,35 +132,40 @@ const ScanProtocolsStep = struct {
|
||||||
const basename = std.fs.path.basename(xml_in_path);
|
const basename = std.fs.path.basename(xml_in_path);
|
||||||
const basename_no_ext = basename[0..(basename.len - 4)];
|
const basename_no_ext = basename[0..(basename.len - 4)];
|
||||||
|
|
||||||
const header_out_path = try std.mem.concat(
|
|
||||||
self.builder.allocator,
|
|
||||||
u8,
|
|
||||||
&[_][]const u8{ "protocol/", basename_no_ext, "-protocol.h" },
|
|
||||||
);
|
|
||||||
const code_out_path = try std.mem.concat(
|
const code_out_path = try std.mem.concat(
|
||||||
self.builder.allocator,
|
self.builder.allocator,
|
||||||
u8,
|
u8,
|
||||||
&[_][]const u8{ "protocol/", basename_no_ext, "-protocol.c" },
|
&[_][]const u8{ "protocol/", basename_no_ext, "-protocol.c" },
|
||||||
);
|
);
|
||||||
|
|
||||||
_ = try self.builder.exec(
|
|
||||||
&[_][]const u8{ "wayland-scanner", "server-header", xml_in_path, header_out_path },
|
|
||||||
);
|
|
||||||
_ = try self.builder.exec(
|
_ = try self.builder.exec(
|
||||||
&[_][]const u8{ "wayland-scanner", "private-code", xml_in_path, code_out_path },
|
&[_][]const u8{ "wayland-scanner", "private-code", xml_in_path, code_out_path },
|
||||||
);
|
);
|
||||||
|
|
||||||
// We need the client header as well for river-control
|
for (server_protocols) |server_protocol| {
|
||||||
if (std.mem.eql(u8, basename_no_ext, "river-control-unstable-v1")) {
|
if (std.mem.eql(u8, basename_no_ext, server_protocol)) {
|
||||||
const client_header_out_path = try std.mem.concat(
|
const header_out_path = try std.mem.concat(
|
||||||
|
self.builder.allocator,
|
||||||
|
u8,
|
||||||
|
&[_][]const u8{ "protocol/", basename_no_ext, "-protocol.h" },
|
||||||
|
);
|
||||||
|
_ = try self.builder.exec(
|
||||||
|
&[_][]const u8{ "wayland-scanner", "server-header", xml_in_path, header_out_path },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (client_protocols) |client_protocol| {
|
||||||
|
if (std.mem.eql(u8, basename_no_ext, client_protocol)) {
|
||||||
|
const header_out_path = try std.mem.concat(
|
||||||
self.builder.allocator,
|
self.builder.allocator,
|
||||||
u8,
|
u8,
|
||||||
&[_][]const u8{ "protocol/", basename_no_ext, "-client-protocol.h" },
|
&[_][]const u8{ "protocol/", basename_no_ext, "-client-protocol.h" },
|
||||||
);
|
);
|
||||||
_ = try self.builder.exec(
|
_ = try self.builder.exec(
|
||||||
&[_][]const u8{ "wayland-scanner", "client-header", xml_in_path, client_header_out_path },
|
&[_][]const u8{ "wayland-scanner", "client-header", xml_in_path, header_out_path },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue