aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-10-29 22:40:28 +0200
committerGitHub <noreply@github.com>2017-10-29 22:40:28 +0200
commit68af8449d8576e27fb0390340f149f3001e8ea5f (patch)
tree921200359a63f5144cfea27ea2aef97e38c91ed1 /mesonbuild
parent1b0048a7022a89f461cf4d01e7cdbf995bab70f5 (diff)
parentcf759e529c9753b30bd926a75f629d3562fca990 (diff)
downloadmeson-68af8449d8576e27fb0390340f149f3001e8ea5f.zip
meson-68af8449d8576e27fb0390340f149f3001e8ea5f.tar.gz
meson-68af8449d8576e27fb0390340f149f3001e8ea5f.tar.bz2
Merge pull request #2529 from leiflm/qt5-add-moc-extra-arguments-keyword
Qt5-Module: Add `moc_extra_arguments` keyword support.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/modules/qt.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/mesonbuild/modules/qt.py b/mesonbuild/modules/qt.py
index 2f24740..0b7354f 100644
--- a/mesonbuild/modules/qt.py
+++ b/mesonbuild/modules/qt.py
@@ -84,10 +84,10 @@ class QtBaseModule:
except Exception:
return []
- @permittedKwargs({'moc_headers', 'moc_sources', 'include_directories', 'ui_files', 'qresources', 'method'})
+ @permittedKwargs({'moc_headers', 'moc_sources', 'moc_extra_arguments', 'include_directories', 'ui_files', 'qresources', 'method'})
def preprocess(self, state, args, kwargs):
- rcc_files, ui_files, moc_headers, moc_sources, sources, include_directories \
- = extract_as_list(kwargs, 'qresources', 'ui_files', 'moc_headers', 'moc_sources', 'sources', 'include_directories', pop = True)
+ rcc_files, ui_files, moc_headers, moc_sources, moc_extra_arguments, sources, include_directories \
+ = extract_as_list(kwargs, 'qresources', 'ui_files', 'moc_headers', 'moc_sources', 'moc_extra_arguments', 'sources', 'include_directories', pop = True)
sources += args[1:]
method = kwargs.get('method', 'auto')
self._detect_tools(state.environment, method)
@@ -122,14 +122,16 @@ class QtBaseModule:
sources.append(ui_output)
inc = get_include_args(include_dirs=include_directories)
if len(moc_headers) > 0:
+ arguments = moc_extra_arguments + inc + ['@INPUT@', '-o', '@OUTPUT@']
moc_kwargs = {'output': 'moc_@BASENAME@.cpp',
- 'arguments': inc + ['@INPUT@', '-o', '@OUTPUT@']}
+ 'arguments': arguments}
moc_gen = build.Generator([self.moc], moc_kwargs)
moc_output = moc_gen.process_files('Qt{} moc header'.format(self.qt_version), moc_headers, state)
sources.append(moc_output)
if len(moc_sources) > 0:
+ arguments = moc_extra_arguments + ['@INPUT@', '-o', '@OUTPUT@']
moc_kwargs = {'output': '@BASENAME@.moc',
- 'arguments': ['@INPUT@', '-o', '@OUTPUT@']}
+ 'arguments': arguments}
moc_gen = build.Generator([self.moc], moc_kwargs)
moc_output = moc_gen.process_files('Qt{} moc source'.format(self.qt_version), moc_sources, state)
sources.append(moc_output)