aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-07-21 10:43:41 -0700
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2021-07-23 00:46:22 +0530
commit5583e44826e66f5721c9c18378f932760baf2263 (patch)
tree521d5d788326b6a8bd04d84affbfe4df26c13338 /mesonbuild
parent4703f4c2444c4a5d61645c4d3d1118f87946335a (diff)
downloadmeson-5583e44826e66f5721c9c18378f932760baf2263.zip
meson-5583e44826e66f5721c9c18378f932760baf2263.tar.gz
meson-5583e44826e66f5721c9c18378f932760baf2263.tar.bz2
qt: Allow CustomTargets for qt.preprocess source arguments
This works for `moc_*` and `ui_files`, but it never could have worked for `qresources` due to the implementation assuming a `str` or `File`. To restore previous compatibility I've added `CustomTarget` where it would have worked, but not where it would have failed, the former would raised an exception along the lines anyway. Fixes #9007
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/modules/qt.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/mesonbuild/modules/qt.py b/mesonbuild/modules/qt.py
index 75e84ab..5efd668 100644
--- a/mesonbuild/modules/qt.py
+++ b/mesonbuild/modules/qt.py
@@ -52,7 +52,7 @@ if T.TYPE_CHECKING:
"""Keyword arguments for the Ui Compiler method."""
- sources: T.List[FileOrString]
+ sources: T.Sequence[T.Union[FileOrString, build.CustomTarget]]
extra_args: T.List[str]
method: str
@@ -60,8 +60,8 @@ if T.TYPE_CHECKING:
"""Keyword arguments for the Moc Compiler method."""
- sources: T.List[FileOrString]
- headers: T.List[FileOrString]
+ sources: T.List[T.Union[FileOrString, build.CustomTarget]]
+ headers: T.List[T.Union[FileOrString, build.CustomTarget]]
extra_args: T.List[str]
method: str
include_directories: T.List[T.Union[str, build.IncludeDirs]]
@@ -70,10 +70,10 @@ if T.TYPE_CHECKING:
class PreprocessKwArgs(TypedDict):
sources: T.List[FileOrString]
- moc_sources: T.List[FileOrString]
- moc_headers: T.List[FileOrString]
+ moc_sources: T.List[T.Union[FileOrString, build.CustomTarget]]
+ moc_headers: T.List[T.Union[FileOrString, build.CustomTarget]]
qresources: T.List[FileOrString]
- ui_files: T.List[FileOrString]
+ ui_files: T.List[T.Union[FileOrString, build.CustomTarget]]
moc_extra_arguments: T.List[str]
rcc_extra_arguments: T.List[str]
uic_extra_arguments: T.List[str]
@@ -366,8 +366,8 @@ class QtBaseModule(ExtensionModule):
@noPosargs
@typed_kwargs(
'qt.compile_moc',
- KwargInfo('sources', ContainerTypeInfo(list, (File, str)), listify=True, default=[]),
- KwargInfo('headers', ContainerTypeInfo(list, (File, str)), listify=True, default=[]),
+ KwargInfo('sources', ContainerTypeInfo(list, (File, str, build.CustomTarget)), listify=True, default=[]),
+ KwargInfo('headers', ContainerTypeInfo(list, (File, str, build.CustomTarget)), listify=True, default=[]),
KwargInfo('extra_args', ContainerTypeInfo(list, str), listify=True, default=[]),
KwargInfo('method', str, default='auto'),
KwargInfo('include_directories', ContainerTypeInfo(list, (build.IncludeDirs, str)), listify=True, default=[]),
@@ -414,9 +414,9 @@ class QtBaseModule(ExtensionModule):
'qt.preprocess',
KwargInfo('sources', ContainerTypeInfo(list, (File, str)), listify=True, default=[], deprecated='0.59.0'),
KwargInfo('qresources', ContainerTypeInfo(list, (File, str)), listify=True, default=[]),
- KwargInfo('ui_files', ContainerTypeInfo(list, (File, str)), listify=True, default=[]),
- KwargInfo('moc_sources', ContainerTypeInfo(list, (File, str)), listify=True, default=[]),
- KwargInfo('moc_headers', ContainerTypeInfo(list, (File, str)), listify=True, default=[]),
+ KwargInfo('ui_files', ContainerTypeInfo(list, (File, str, build.CustomTarget)), listify=True, default=[]),
+ KwargInfo('moc_sources', ContainerTypeInfo(list, (File, str, build.CustomTarget)), listify=True, default=[]),
+ KwargInfo('moc_headers', ContainerTypeInfo(list, (File, str, build.CustomTarget)), listify=True, default=[]),
KwargInfo('moc_extra_arguments', ContainerTypeInfo(list, str), listify=True, default=[], since='0.44.0'),
KwargInfo('rcc_extra_arguments', ContainerTypeInfo(list, str), listify=True, default=[], since='0.49.0'),
KwargInfo('uic_extra_arguments', ContainerTypeInfo(list, str), listify=True, default=[], since='0.49.0'),