diff options
author | Mark Bolhuis <mark@bolhuis.dev> | 2022-09-05 22:14:40 +0100 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2022-09-06 18:08:39 -0400 |
commit | 25f838fd3328273733976b16775142a58e3db275 (patch) | |
tree | 594f0cfc7fa465b4307c15e702aacff603e3b49e /mesonbuild/modules/wayland.py | |
parent | a4d54422077a6fb7fe7af072e0563b58e602d4ae (diff) | |
download | meson-25f838fd3328273733976b16775142a58e3db275.zip meson-25f838fd3328273733976b16775142a58e3db275.tar.gz meson-25f838fd3328273733976b16775142a58e3db275.tar.bz2 |
modules/wayland: Support --include-core-only
wayland-scanner can generate header files that only include
wayland-client-core.h using a flag.
Add a core_only option to scan_xml to support this use case.
Diffstat (limited to 'mesonbuild/modules/wayland.py')
-rw-r--r-- | mesonbuild/modules/wayland.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/modules/wayland.py b/mesonbuild/modules/wayland.py index bcb5b95..1b2b333 100644 --- a/mesonbuild/modules/wayland.py +++ b/mesonbuild/modules/wayland.py @@ -37,6 +37,7 @@ if T.TYPE_CHECKING: public: bool client: bool server: bool + core_only: bool class FindProtocol(TypedDict): @@ -65,6 +66,7 @@ class WaylandModule(ExtensionModule): KwargInfo('public', bool, default=False), KwargInfo('client', bool, default=True), KwargInfo('server', bool, default=False), + KwargInfo('core_only', bool, default=False, since='0.64.0'), ) def scan_xml(self, state: ModuleState, args: T.Tuple[T.List[FileOrString]], kwargs: ScanXML) -> ModuleReturnValue: if self.scanner_bin is None: @@ -98,12 +100,16 @@ class WaylandModule(ExtensionModule): targets.append(code) for side in sides: + command = [self.scanner_bin, f'{side}-header', '@INPUT@', '@OUTPUT@'] + if kwargs['core_only']: + command.append('--include-core-only') + header = CustomTarget( f'{name}-{side}-protocol', state.subdir, state.subproject, state.environment, - [self.scanner_bin, f'{side}-header', '@INPUT@', '@OUTPUT@'], + command, [xml_file], [f'{name}-{side}-protocol.h'], backend=state.backend, |