fixes for macos, submitting to linux machine for regenerating protocols

This commit is contained in:
Peter Li 2026-10-04 16:14:22 -07:00
parent 8dabc0ffb9
commit 21171592fd
2 changed files with 6 additions and 3 deletions

View File

@ -45,8 +45,6 @@ pub fn configure(b: *std.Build, module: *std.Build.Module, target: std.Build.Res
.flags = &.{
"-std=c99",
"-fdata-sections",
"-include",
"private-symbols.h",
},
});
}

View File

@ -47,7 +47,12 @@ def generate(root, version):
name = interface.attrib['name'] + '_interface'
symbols.append(f'#define {name} z_uhdk_{name}')
for mode, suffix in [('client-header', '.h'), ('private-code', '.c')]:
subprocess.run(['wayland-scanner', mode, str(xml), str(output / (('wayland-client-protocol' if xml.stem == 'wayland' and mode == 'client-header' else xml.stem) + suffix))], check=True)
target = output / (('wayland-client-protocol' if xml.stem == 'wayland' and mode == 'client-header' else xml.stem) + suffix)
subprocess.run(['wayland-scanner', mode, str(xml), str(target)], check=True)
if mode == 'private-code':
# Rename the descriptors before the scanner's definitions; a -include flag cannot
# name this file because Zig 0.17 build scripts cannot resolve absolute paths.
target.write_text('#include "private-symbols.h"\n' + target.read_text())
(output / 'private-symbols.h').write_text('\n'.join(symbols) + '\n')