summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/backend/backends.py2
-rw-r--r--mesonbuild/build.py7
-rw-r--r--mesonbuild/interpreter/interpreterobjects.py2
-rw-r--r--mesonbuild/modules/_qt.py8
4 files changed, 9 insertions, 10 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index b2d4e5a00..31082ddc6 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -2038,7 +2038,7 @@ class Backend:
exe, args + commands.to_native(),
[output_templ], depfile='@PLAINNAME@.d',
depends=depends)
- return generator.process_files(sources, self.interpreter)
+ return generator.process_files(sources)
def compile_target_to_generator(self, target: build.CompileTarget) -> build.GeneratedList:
all_sources = T.cast('_ALL_SOURCES_TYPE', target.sources) + T.cast('_ALL_SOURCES_TYPE', target.generated)
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index c1a92e2ba..df01282fb 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -47,7 +47,6 @@ if T.TYPE_CHECKING:
from .interpreterbase import SubProject
from .linkers.linkers import StaticLinker
from .mesonlib import ExecutableSerialisation, FileMode, FileOrString
- from .modules import ModuleState
from .mparser import BaseNode
from .interpreter.kwargs import RustAbi
@@ -2033,13 +2032,13 @@ class Generator(HoldableObject):
return [x.replace('@BASENAME@', basename).replace('@PLAINNAME@', plainname) for x in self.arglist]
def process_files(self, files: T.Iterable[T.Union[str, File, GeneratedTypes]],
- state: T.Union['Interpreter', 'ModuleState'],
+ subdir: str = '',
preserve_path_from: T.Optional[str] = None,
extra_args: T.Optional[T.List[str]] = None,
env: T.Optional[EnvironmentVariables] = None) -> 'GeneratedList':
output = GeneratedList(
self,
- state.subdir,
+ subdir,
preserve_path_from,
extra_args=extra_args if extra_args is not None else [],
env=env if env is not None else EnvironmentVariables())
@@ -2054,7 +2053,7 @@ class Generator(HoldableObject):
output.depends.add(e)
fs = [FileInTargetPrivateDir(f) for f in e.get_outputs()]
elif isinstance(e, str):
- fs = [File.from_source_file(self.environment.source_dir, state.subdir, e)]
+ fs = [File.from_source_file(self.environment.source_dir, subdir, e)]
else:
fs = [e]
diff --git a/mesonbuild/interpreter/interpreterobjects.py b/mesonbuild/interpreter/interpreterobjects.py
index 86e8957bc..d5a78c10e 100644
--- a/mesonbuild/interpreter/interpreterobjects.py
+++ b/mesonbuild/interpreter/interpreterobjects.py
@@ -1153,7 +1153,7 @@ class GeneratorHolder(ObjectHolder[build.Generator]):
'Calling generator.process with CustomTarget or Index of CustomTarget.',
'0.57.0', self.interpreter.subproject)
- gl = self.held_object.process_files(args[0], self.interpreter,
+ gl = self.held_object.process_files(args[0], self.interpreter.subdir,
preserve_path_from, extra_args=kwargs['extra_args'], env=kwargs['env'])
return gl
diff --git a/mesonbuild/modules/_qt.py b/mesonbuild/modules/_qt.py
index 650523904..ef3193b9c 100644
--- a/mesonbuild/modules/_qt.py
+++ b/mesonbuild/modules/_qt.py
@@ -519,7 +519,7 @@ class QtBaseModule(ExtensionModule):
kwargs['extra_args'] + ['-o', '@OUTPUT@', '@INPUT@'],
['ui_@BASENAME@.h'],
name=f'Qt{self.qt_version} ui')
- return gen.process_files(kwargs['sources'], state, preserve_path_from)
+ return gen.process_files(kwargs['sources'], state.subdir, preserve_path_from)
@FeatureNew('qt.compile_moc', '0.59.0')
@noPosargs
@@ -594,7 +594,7 @@ class QtBaseModule(ExtensionModule):
self.tools['moc'], arguments, header_gen_output,
depfile='moc_@BASENAME@.cpp.d',
name=f'Qt{self.qt_version} moc header')
- output.append(moc_gen.process_files(kwargs['headers'], state, preserve_path_from))
+ output.append(moc_gen.process_files(kwargs['headers'], state.subdir, preserve_path_from))
if kwargs['sources']:
source_gen_output: T.List[str] = ['@BASENAME@.moc']
if do_output_json:
@@ -604,7 +604,7 @@ class QtBaseModule(ExtensionModule):
self.tools['moc'], arguments, source_gen_output,
depfile='@BASENAME@.moc.d',
name=f'Qt{self.qt_version} moc source')
- output.append(moc_gen.process_files(kwargs['sources'], state, preserve_path_from))
+ output.append(moc_gen.process_files(kwargs['sources'], state.subdir, preserve_path_from))
return output
@@ -902,7 +902,7 @@ class QtBaseModule(ExtensionModule):
name=f'Qml cache generation for {target_name}')
output: T.List[T.Union[build.CustomTarget, build.GeneratedList]] = []
- output.append(cache_gen.process_files(kwargs['qml_sources'], state))
+ output.append(cache_gen.process_files(kwargs['qml_sources'], state.subdir))
cachegen_inputs: T.List[str] = []
qml_sources_paths = self._source_to_files(state, kwargs['qml_sources'])