diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 138f1ae03233..5bf1756d2c3f 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -22,7 +22,7 @@ from .mesonlib import ( HoldableObject, SecondLevelHolder, File, MesonException, MachineChoice, PerMachine, OrderedSet, listify, - extract_as_list, typeslistify, stringlistify, classify_unity_sources, + extract_as_list, typeslistify, classify_unity_sources, get_filenames_templates_dict, substitute_values, has_path_sep, is_parent_path, relpath, PerMachineDefaultable, MesonBugException, EnvironmentVariables, pickle_load, lazy_property, @@ -85,7 +85,7 @@ class BuildTargetKeywordArguments(TypedDict, total=False): install_dir: T.List[T.Union[str, Literal[False]]] install_mode: FileMode install_rpath: str - install_tag: T.List[str] + install_tag: T.List[T.Optional[str]] language_args: T.DefaultDict[str, T.List[str]] link_args: T.List[str] link_depends: T.List[T.Union[str, File, CustomTarget, CustomTargetIndex]] @@ -1295,7 +1295,7 @@ def process_kwargs(self, kwargs: BuildTargetKeywordArguments) -> None: self.install_dir = typeslistify(kwargs.get('install_dir', []), (str, bool)) self.install_mode = kwargs.get('install_mode', None) - self.install_tag = stringlistify(kwargs.get('install_tag', [None])) + self.install_tag: T.List[T.Optional[str]] = kwargs.get('install_tag') or [None] self.extra_files = kwargs.get('extra_files', []) self.install_rpath: str = kwargs.get('install_rpath', '') self.build_rpath = kwargs.get('build_rpath', '') diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 56659460a844..e3d321e9ad64 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -3553,6 +3553,8 @@ def build_target(self, node: mparser.BaseNode, args: T.Tuple[str, SourcesVarargs if isinstance(kwargs['implib'], bool): kwargs['implib'] = None + kwargs['install_tag'] = [kwargs['install_tag']] + target = targetclass(name, self.subdir, self.subproject, for_machine, srcs, struct, objs, self.environment, self.compilers[for_machine], kwargs) if objs and target.uses_rust(): diff --git a/mesonbuild/interpreter/kwargs.py b/mesonbuild/interpreter/kwargs.py index 4935973d95d4..1e206422fece 100644 --- a/mesonbuild/interpreter/kwargs.py +++ b/mesonbuild/interpreter/kwargs.py @@ -341,6 +341,7 @@ class _BaseBuildTarget(TypedDict): gnu_symbol_visibility: str install: bool install_mode: FileMode + install_tag: T.Optional[str] install_rpath: str implicit_include_directories: bool link_depends: T.List[T.Union[str, File, build.GeneratedTypes]] diff --git a/mesonbuild/interpreter/type_checking.py b/mesonbuild/interpreter/type_checking.py index 28280a996538..b5f741ea02b8 100644 --- a/mesonbuild/interpreter/type_checking.py +++ b/mesonbuild/interpreter/type_checking.py @@ -614,6 +614,7 @@ def _extra_files_validator(args: T.List[T.Union[File, str]]) -> T.Optional[str]: feature_validator=_target_install_feature_validator, ), INSTALL_MODE_KW, + INSTALL_TAG_KW, KwargInfo('implicit_include_directories', bool, default=True, since='0.42.0'), NATIVE_KW, KwargInfo('resources', ContainerTypeInfo(list, str), default=[], listify=True),