aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/unstable_wayland.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2022-03-01 18:01:38 -0500
committerXavier Claessens <xclaesse@gmail.com>2022-03-06 06:31:43 -0500
commite80a9c2cbac3080dad6e55c070c83cac47d6d7f8 (patch)
tree5f7303c29984e39245be41ed6db7857341aab14f /mesonbuild/modules/unstable_wayland.py
parentaf9af219d815f157acd2dd4629727fcd90aa9d86 (diff)
downloadmeson-e80a9c2cbac3080dad6e55c070c83cac47d6d7f8.zip
meson-e80a9c2cbac3080dad6e55c070c83cac47d6d7f8.tar.gz
meson-e80a9c2cbac3080dad6e55c070c83cac47d6d7f8.tar.bz2
wayland module: Allow building both client and server sides
- Change `scope` kwarg to `public` boolean default to false. - Change `side` kwarg to `client` and `server` booleans. - Document returned values - Aggregate in a single unit test because have lots of small tests increases CI time. Fixes: #10040.
Diffstat (limited to 'mesonbuild/modules/unstable_wayland.py')
-rw-r--r--mesonbuild/modules/unstable_wayland.py32
1 files changed, 18 insertions, 14 deletions
diff --git a/mesonbuild/modules/unstable_wayland.py b/mesonbuild/modules/unstable_wayland.py
index 85da2b7..a7653d9 100644
--- a/mesonbuild/modules/unstable_wayland.py
+++ b/mesonbuild/modules/unstable_wayland.py
@@ -39,15 +39,18 @@ class WaylandModule(ExtensionModule):
@typed_pos_args('wayland.scan_xml', varargs=(str, File), min_varargs=1)
@typed_kwargs(
'wayland.scan_xml',
- KwargInfo('side', str, default='client', validator=in_set_validator({'client', 'server'})),
- KwargInfo('scope', str, default='private', validator=in_set_validator({'private', 'public'})),
+ KwargInfo('public', bool, default=False),
+ KwargInfo('client', bool, default=True),
+ KwargInfo('server', bool, default=False),
)
def scan_xml(self, state, args, kwargs):
if self.scanner_bin is None:
self.scanner_bin = state.find_program('wayland-scanner', for_machine=MachineChoice.BUILD)
- scope = kwargs['scope']
- side = kwargs['side']
+ scope = 'public' if kwargs['public'] else 'private'
+ sides = [i for i in ['client', 'server'] if kwargs[i]]
+ if not sides:
+ raise MesonException('At least one of client or server keyword argument must be set to true.')
xml_files = self.interpreter.source_strings_to_files(args[0])
targets = []
@@ -65,16 +68,17 @@ class WaylandModule(ExtensionModule):
)
targets.append(code)
- header = CustomTarget(
- f'{name}-{side}-protocol',
- state.subdir,
- state.subproject,
- [self.scanner_bin, f'{side}-header', '@INPUT@', '@OUTPUT@'],
- [xml_file],
- [f'{name}-{side}-protocol.h'],
- backend=state.backend,
- )
- targets.append(header)
+ for side in sides:
+ header = CustomTarget(
+ f'{name}-{side}-protocol',
+ state.subdir,
+ state.subproject,
+ [self.scanner_bin, f'{side}-header', '@INPUT@', '@OUTPUT@'],
+ [xml_file],
+ [f'{name}-{side}-protocol.h'],
+ backend=state.backend,
+ )
+ targets.append(header)
return ModuleReturnValue(targets, targets)