diff options
-rw-r--r-- | mesonbuild/build.py | 10 | ||||
-rw-r--r-- | mesonbuild/modules/qt.py | 17 |
2 files changed, 17 insertions, 10 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index ddce65c..24cddb0 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -1504,13 +1504,15 @@ class Generator: *, depfile: T.Optional[str] = None, capture: bool = False, - depends: T.Optional[T.List[T.Union[BuildTarget, 'CustomTarget']]] = None): + depends: T.Optional[T.List[T.Union[BuildTarget, 'CustomTarget']]] = None, + name: str = 'Generator'): self.exe = exe self.depfile = depfile self.capture = capture self.depends: T.List[T.Union[BuildTarget, 'CustomTarget']] = depends or [] self.arglist = arguments self.outputs = output + self.name = name def __repr__(self): repr_str = "<{0}: {1}>" @@ -1541,7 +1543,7 @@ class Generator: relpath = pathlib.PurePath(trial).relative_to(parent) return relpath.parts[0] != '..' # For subdirs we can only go "down". - def process_files(self, name, files, state: 'Interpreter', preserve_path_from=None, extra_args=None): + def process_files(self, files, state, preserve_path_from=None, extra_args=None): new = False output = GeneratedList(self, state.subdir, preserve_path_from, extra_args=extra_args if extra_args is not None else []) #XXX @@ -1560,7 +1562,7 @@ class Generator: elif isinstance(e, str): fs = [File.from_source_file(state.environment.source_dir, state.subdir, e)] elif not isinstance(e, File): - raise InvalidArguments(f'{name} arguments must be strings, files or CustomTargets, not {e!r}.') + raise InvalidArguments(f'{self.name} arguments must be strings, files or CustomTargets, not {e!r}.') for f in fs: if preserve_path_from: @@ -1570,7 +1572,7 @@ class Generator: output.add_file(f, state) if new: FeatureNew.single_use( - f'Calling "{name}" with CustomTaget or Index of CustomTarget.', + f'Calling "{self.name}" with CustomTaget or Index of CustomTarget.', '0.57.0', state.subproject) return output diff --git a/mesonbuild/modules/qt.py b/mesonbuild/modules/qt.py index f328027..adfc8e2 100644 --- a/mesonbuild/modules/qt.py +++ b/mesonbuild/modules/qt.py @@ -348,8 +348,9 @@ class QtBaseModule(ExtensionModule): gen = build.Generator( self.uic, kwargs['extra_args'] + ['-o', '@OUTPUT@', '@INPUT@'], - ['ui_@BASENAME@.h']) - out = gen.process_files(f'Qt{self.qt_version} ui', kwargs['sources'], state) # type: ignore + ['ui_@BASENAME@.h'], + name=f'Qt{self.qt_version} ui') + out = gen.process_files(kwargs['sources'], state) # type: ignore return ModuleReturnValue(out, [out]) @FeatureNew('qt.compile_moc', '0.59.0') @@ -382,11 +383,15 @@ class QtBaseModule(ExtensionModule): arguments = kwargs['extra_args'] + inc + compile_args + ['@INPUT@', '-o', '@OUTPUT@'] if kwargs['headers']: - moc_gen = build.Generator(self.moc, arguments, ['moc_@BASENAME@.cpp']) - output.append(moc_gen.process_files(f'Qt{self.qt_version} moc header', kwargs['headers'], state)) # type: ignore + moc_gen = build.Generator( + self.moc, arguments, ['moc_@BASENAME@.cpp'], + name=f'Qt{self.qt_version} moc header') + output.append(moc_gen.process_files(kwargs['headers'], state)) # type: ignore if kwargs['sources']: - moc_gen = build.Generator(self.moc, arguments, ['@BASENAME@.moc']) - output.append(moc_gen.process_files(f'Qt{self.qt_version} moc source', kwargs['sources'], state)) # type: ignore + moc_gen = build.Generator( + self.moc, arguments, ['@BASENAME@.moc'], + name=f'Qt{self.qt_version} moc source') + output.append(moc_gen.process_files(kwargs['sources'], state)) # type: ignore return ModuleReturnValue(output, [output]) |