diff options
-rw-r--r-- | docs/markdown/_include_qt_base.md | 5 | ||||
-rw-r--r-- | mesonbuild/modules/qt.py | 11 |
2 files changed, 12 insertions, 4 deletions
diff --git a/docs/markdown/_include_qt_base.md b/docs/markdown/_include_qt_base.md index 881d1bf..63b21e1 100644 --- a/docs/markdown/_include_qt_base.md +++ b/docs/markdown/_include_qt_base.md @@ -21,8 +21,9 @@ It takes no positional arguments, and the following keyword arguments: Compiles Qt's ui files (.ui) into header files. It takes no positional arguments, and the following keyword arguments: - - `sources` (File | string)[]: A list of sources to be transpiled. Required, - must have at least one source + - `sources` (File | string | custom_target | custom_target index | generator_output)[]: + A list of sources to be transpiled. Required, must have at least one source + *New in 0.60.0*: support for custom_target, custom_target_index, and generator_output. - `extra_args` string[]: Extra arguments to pass directly to `qt-uic` - `method` string: The method to use to detect qt, see `dependency()` for more information. diff --git a/mesonbuild/modules/qt.py b/mesonbuild/modules/qt.py index 653c6f2..3987af4 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.Sequence[T.Union[FileOrString, build.CustomTarget]] + sources: T.Sequence[T.Union[FileOrString, build.CustomTarget, build.CustomTargetIndex, build.GeneratedList]] extra_args: T.List[str] method: str @@ -337,12 +337,19 @@ class QtBaseModule(ExtensionModule): @noPosargs @typed_kwargs( 'qt.compile_ui', - KwargInfo('sources', ContainerTypeInfo(list, (File, str), allow_empty=False), listify=True, required=True), + KwargInfo( + 'sources', + ContainerTypeInfo(list, (File, str, build.CustomTarget, build.CustomTargetIndex, build.GeneratedList), allow_empty=False), + listify=True, + required=True, + ), KwargInfo('extra_args', ContainerTypeInfo(list, str), listify=True, default=[]), KwargInfo('method', str, default='auto') ) def compile_ui(self, state: 'ModuleState', args: T.Tuple, kwargs: 'UICompilerKwArgs') -> ModuleReturnValue: """Compile UI resources into cpp headers.""" + if any(isinstance(s, (build.CustomTarget, build.CustomTargetIndex, build.GeneratedList)) for s in kwargs['sources']): + FeatureNew.single_use('qt.compile_ui: custom_target or generator for "sources" keyword argument', '0.60.0', state.subproject) out = self._compile_ui_impl(state, kwargs) return ModuleReturnValue(out, [out]) |