Skip to content

Commit f53cbe4

Browse files
committed
build|interpreter: use typed_kwargs for BuildTarget(install_tag)
1 parent 5d89529 commit f53cbe4

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

mesonbuild/build.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from .mesonlib import (
2323
HoldableObject, SecondLevelHolder,
2424
File, MesonException, MachineChoice, PerMachine, OrderedSet, listify,
25-
extract_as_list, typeslistify, stringlistify, classify_unity_sources,
25+
extract_as_list, typeslistify, classify_unity_sources,
2626
get_filenames_templates_dict, substitute_values, has_path_sep,
2727
is_parent_path, relpath, PerMachineDefaultable,
2828
MesonBugException, EnvironmentVariables, pickle_load, lazy_property,
@@ -85,7 +85,7 @@ class BuildTargetKeywordArguments(TypedDict, total=False):
8585
install_dir: T.List[T.Union[str, Literal[False]]]
8686
install_mode: FileMode
8787
install_rpath: str
88-
install_tag: T.List[str]
88+
install_tag: T.List[T.Optional[str]]
8989
language_args: T.DefaultDict[str, T.List[str]]
9090
link_args: T.List[str]
9191
link_depends: T.List[T.Union[str, File, CustomTarget, CustomTargetIndex]]
@@ -1295,7 +1295,7 @@ def process_kwargs(self, kwargs: BuildTargetKeywordArguments) -> None:
12951295
self.install_dir = typeslistify(kwargs.get('install_dir', []),
12961296
(str, bool))
12971297
self.install_mode = kwargs.get('install_mode', None)
1298-
self.install_tag = stringlistify(kwargs.get('install_tag', [None]))
1298+
self.install_tag: T.List[T.Optional[str]] = kwargs.get('install_tag') or [None]
12991299
self.extra_files = kwargs.get('extra_files', [])
13001300
self.install_rpath: str = kwargs.get('install_rpath', '')
13011301
self.build_rpath = kwargs.get('build_rpath', '')

mesonbuild/interpreter/interpreter.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3553,6 +3553,8 @@ def build_target(self, node: mparser.BaseNode, args: T.Tuple[str, SourcesVarargs
35533553
if isinstance(kwargs['implib'], bool):
35543554
kwargs['implib'] = None
35553555

3556+
kwargs['install_tag'] = [kwargs['install_tag']]
3557+
35563558
target = targetclass(name, self.subdir, self.subproject, for_machine, srcs, struct, objs,
35573559
self.environment, self.compilers[for_machine], kwargs)
35583560
if objs and target.uses_rust():

mesonbuild/interpreter/kwargs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ class _BaseBuildTarget(TypedDict):
341341
gnu_symbol_visibility: str
342342
install: bool
343343
install_mode: FileMode
344+
install_tag: T.Optional[str]
344345
install_rpath: str
345346
implicit_include_directories: bool
346347
link_depends: T.List[T.Union[str, File, build.GeneratedTypes]]

mesonbuild/interpreter/type_checking.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ def _extra_files_validator(args: T.List[T.Union[File, str]]) -> T.Optional[str]:
614614
feature_validator=_target_install_feature_validator,
615615
),
616616
INSTALL_MODE_KW,
617+
INSTALL_TAG_KW,
617618
KwargInfo('implicit_include_directories', bool, default=True, since='0.42.0'),
618619
NATIVE_KW,
619620
KwargInfo('resources', ContainerTypeInfo(list, str), default=[], listify=True),

0 commit comments

Comments
 (0)