diff --git a/mesonbuild/modules/wayland.py b/mesonbuild/modules/wayland.py index e17cf995ced3..1dfa8fc7c969 100644 --- a/mesonbuild/modules/wayland.py +++ b/mesonbuild/modules/wayland.py @@ -112,11 +112,13 @@ def scan_xml(self, state: ModuleState, args: T.Tuple[T.List[FileOrString]], kwar 'wayland.find_protocol', KwargInfo('state', str, default='stable', validator=in_set_validator({'stable', 'staging', 'unstable'})), KwargInfo('version', (int, NoneType)), + KwargInfo('vendored', bool, default=False, since='1.6.0'), ) def find_protocol(self, state: ModuleState, args: T.Tuple[str], kwargs: FindProtocol) -> File: base_name = args[0] xml_state = kwargs['state'] version = kwargs['version'] + vendored = kwargs['vendored'] if xml_state != 'stable' and version is None: raise MesonException(f'{xml_state} protocols require a version number.') @@ -137,7 +139,10 @@ def find_protocol(self, state: ModuleState, args: T.Tuple[str], kwargs: FindProt xml_name += f'-v{version}' xml_name += '.xml' - path = os.path.join(self.pkgdatadir, xml_state, base_name, xml_name) + if vendored: + path = os.path.join(self.interpreter.subdir, xml_name) + else: + path = os.path.join(self.pkgdatadir, xml_state, base_name, xml_name) if not os.path.exists(path): raise MesonException(f'The file {path} does not exist.')