aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-06-01 21:13:38 -0700
committerDylan Baker <dylan@pnwbakers.com>2021-06-15 12:48:53 -0700
commit35bdaada1dfb64366f1533a79fea670502f69732 (patch)
treee334647e95426a6505b6365ab1cba58ddbd2ecd7 /mesonbuild/modules
parent491c756dc99fa4b126ddcbbee7de149d47c9199f (diff)
downloadmeson-35bdaada1dfb64366f1533a79fea670502f69732.zip
meson-35bdaada1dfb64366f1533a79fea670502f69732.tar.gz
meson-35bdaada1dfb64366f1533a79fea670502f69732.tar.bz2
interpreter|build: Do Generator keyword argument checking in the interpreter
For qt we already have all of the necissary checking in place. Now in the interpreter we have the same, the intrperter does all of the checking, then passed the arguments to the Generator initializer, which just assigns the passed values. This is nice, neat, and clean and fixes the layering violatino between build and interpreter.
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r--mesonbuild/modules/qt.py22
1 files changed, 9 insertions, 13 deletions
diff --git a/mesonbuild/modules/qt.py b/mesonbuild/modules/qt.py
index 76cc4db..f328027 100644
--- a/mesonbuild/modules/qt.py
+++ b/mesonbuild/modules/qt.py
@@ -344,12 +344,12 @@ class QtBaseModule(ExtensionModule):
"please check your qt{2} installation")
raise MesonException(err_msg.format('UIC', f'uic-qt{self.qt_version}', self.qt_version))
- ui_kwargs: T.Dict[str, T.Any] = { # TODO: if Generator was properly annotatedā€¦
- 'output': 'ui_@BASENAME@.h',
- 'arguments': kwargs['extra_args'] + ['-o', '@OUTPUT@', '@INPUT@']}
# TODO: This generator isn't added to the generator list in the Interpreter
- gen = build.Generator(self.uic, ui_kwargs) # type: ignore
- out = gen.process_files(f'Qt{self.qt_version} ui', kwargs['sources'], state)
+ 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
return ModuleReturnValue(out, [out])
@FeatureNew('qt.compile_moc', '0.59.0')
@@ -382,15 +382,11 @@ class QtBaseModule(ExtensionModule):
arguments = kwargs['extra_args'] + inc + compile_args + ['@INPUT@', '-o', '@OUTPUT@']
if kwargs['headers']:
- moc_kwargs = {'output': 'moc_@BASENAME@.cpp',
- 'arguments': arguments}
- moc_gen = build.Generator(self.moc, moc_kwargs) # type: ignore
- output.append(moc_gen.process_files(f'Qt{self.qt_version} moc header', kwargs['headers'], state))
+ 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
if kwargs['sources']:
- moc_kwargs = {'output': '@BASENAME@.moc',
- 'arguments': arguments}
- moc_gen = build.Generator(self.moc, moc_kwargs) # type: ignore
- output.append(moc_gen.process_files(f'Qt{self.qt_version} moc source', kwargs['sources'], state))
+ 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
return ModuleReturnValue(output, [output])