diff options
-rw-r--r-- | docs/markdown/Qt5-module.md | 8 | ||||
-rw-r--r-- | mesonbuild/modules/qt.py | 5 |
2 files changed, 9 insertions, 4 deletions
diff --git a/docs/markdown/Qt5-module.md b/docs/markdown/Qt5-module.md index 71eacbc..9603e1b 100644 --- a/docs/markdown/Qt5-module.md +++ b/docs/markdown/Qt5-module.md @@ -12,8 +12,11 @@ Has the following signature: `qt.preprocess(name: str | None, *sources: str)` If the `name` parameter is passed then all of the rcc files will be wirtten to a single output file -The variadic `sources` arguments have been deprecated since Meson 0.59.0, use -the `sources` keyword argument instead. +The variadic `sources` arguments have been deprecated since Meson 0.59.0, as has the `sources` keyword argument. These passed files unmodified through the preprocessor, don't do this, just add the output of the generator to another sources list: +```meson +sources = files('a.cpp', 'main.cpp', 'bar.c') +sources += qt.preprocess(qresources : ['resources']) +``` This method takes the following keyword arguments: - `qresources`: a list of strings, Files, Custom Targets, or Build Targets to pass the `rcc` compiler @@ -25,6 +28,7 @@ This method takes the following keyword arguments: - `uic_extra_arguments`, any additional arguments to `uic` (optional). Available since v0.49.0. - `rcc_extra_arguments`, any additional arguments to `rcc` (optional). Available since v0.49.0. - `dependencies`, dependency objects needed by moc. Available since v0.48.0. + - `sources`, a list of extra sources, which are added to the output unchaged. Deprecated in 0.59.0 It returns an array of targets and sources to pass to a compilation target. diff --git a/mesonbuild/modules/qt.py b/mesonbuild/modules/qt.py index d14bfd2..c41ec9d 100644 --- a/mesonbuild/modules/qt.py +++ b/mesonbuild/modules/qt.py @@ -24,7 +24,7 @@ from ..mesonlib import MesonException, extract_as_list, File, unholder, version_ from ..dependencies import Dependency import xml.etree.ElementTree as ET from . import ModuleReturnValue, ExtensionModule -from ..interpreterbase import FeatureDeprecated, noPosargs, permittedKwargs, FeatureNew, FeatureNewKwargs +from ..interpreterbase import FeatureDeprecated, FeatureDeprecatedKwargs, noPosargs, permittedKwargs, FeatureNew, FeatureNewKwargs from ..interpreter import extract_required_kwarg from ..programs import NonExistingExternalProgram @@ -190,13 +190,14 @@ class QtBaseModule(ExtensionModule): @FeatureNewKwargs('qt.preprocess', '0.49.0', ['uic_extra_arguments']) @FeatureNewKwargs('qt.preprocess', '0.44.0', ['moc_extra_arguments']) @FeatureNewKwargs('qt.preprocess', '0.49.0', ['rcc_extra_arguments']) + @FeatureDeprecatedKwargs('qt.preprocess', '0.59.0', ['sources']) @permittedKwargs({'moc_headers', 'moc_sources', 'uic_extra_arguments', 'moc_extra_arguments', 'rcc_extra_arguments', 'include_directories', 'dependencies', 'ui_files', 'qresources', 'method'}) def preprocess(self, state, args, kwargs): rcc_files, ui_files, moc_headers, moc_sources, uic_extra_arguments, moc_extra_arguments, rcc_extra_arguments, sources, include_directories, dependencies \ = [extract_as_list(kwargs, c, pop=True) for c in ['qresources', 'ui_files', 'moc_headers', 'moc_sources', 'uic_extra_arguments', 'moc_extra_arguments', 'rcc_extra_arguments', 'sources', 'include_directories', 'dependencies']] _sources = args[1:] if _sources: - FeatureDeprecated.single_use('qt.preprocess positional sources', '0.59', state.subproject, 'use the "sources" keyword argument instead') + FeatureDeprecated.single_use('qt.preprocess positional sources', '0.59', state.subproject) sources.extend(_sources) method = kwargs.get('method', 'auto') self._detect_tools(state, method) |