mirror of
https://github.com/zoriya/zig-wayland.git
synced 2026-06-09 13:01:17 +00:00
Convert relative to absolute paths if needed
This commit is contained in:
@@ -55,7 +55,13 @@ pub const ScanProtocolsStep = struct {
|
||||
|
||||
/// Generate bindings from the protocol xml at the given path
|
||||
pub fn addProtocolPath(self: *ScanProtocolsStep, path: []const u8) void {
|
||||
self.protocol_paths.append(path) catch unreachable;
|
||||
if (std.fs.path.isAbsolute(path)) {
|
||||
self.protocol_paths.append(path) catch unreachable;
|
||||
} else {
|
||||
const pwd = std.os.getenv("PWD") orelse unreachable;
|
||||
const abs_path = std.fs.path.join(self.builder.allocator, &[_][]const u8{ pwd, path }) catch unreachable;
|
||||
self.protocol_paths.append(abs_path) catch unreachable;
|
||||
}
|
||||
}
|
||||
|
||||
/// Generate bindings from protocol xml provided by the wayland-protocols
|
||||
|
||||
Reference in New Issue
Block a user