interpreter: use a shared KwargInfo for install_tag

The kind that takes a single argument, not the custom_target version
that takes an array
pull/10044/head
Dylan Baker 3 years ago committed by Eli Schwartz
parent f03c712d17
commit 272308ff05
  1. 7
      mesonbuild/interpreter/interpreter.py
  2. 2
      mesonbuild/interpreter/type_checking.py

@ -68,6 +68,7 @@ from .type_checking import (
INSTALL_KW,
INSTALL_MODE_KW,
CT_INSTALL_TAG_KW,
INSTALL_TAG_KW,
LANGUAGE_KW,
NATIVE_KW, OVERRIDE_OPTIONS_KW,
REQUIRED_KW,
@ -2061,7 +2062,7 @@ external dependencies (including libraries) must go to "dependencies".''')
'install_symlink',
KwargInfo('pointing_to', str, required=True),
KwargInfo('install_dir', str, required=True),
KwargInfo('install_tag', (str, NoneType)),
INSTALL_TAG_KW,
)
def func_install_symlink(self, node: mparser.BaseNode,
args: T.Tuple[T.List[str]],
@ -2159,7 +2160,7 @@ external dependencies (including libraries) must go to "dependencies".''')
KwargInfo('sources', ContainerTypeInfo(list, (str, mesonlib.File)), listify=True, default=[]),
KwargInfo('rename', ContainerTypeInfo(list, str), default=[], listify=True, since='0.46.0'),
INSTALL_MODE_KW.evolve(since='0.38.0'),
KwargInfo('install_tag', (str, NoneType), since='0.60.0'),
INSTALL_TAG_KW.evolve(since='0.60.0'),
)
def func_install_data(self, node: mparser.BaseNode,
args: T.Tuple[T.List['mesonlib.FileOrString']],
@ -2197,7 +2198,6 @@ external dependencies (including libraries) must go to "dependencies".''')
@typed_kwargs(
'install_subdir',
KwargInfo('install_dir', str, required=True),
KwargInfo('install_tag', (str, NoneType), since='0.60.0'),
KwargInfo('strip_directory', bool, default=False),
KwargInfo('exclude_files', ContainerTypeInfo(list, str),
default=[], listify=True, since='0.42.0',
@ -2206,6 +2206,7 @@ external dependencies (including libraries) must go to "dependencies".''')
default=[], listify=True, since='0.42.0',
validator=lambda x: 'cannot be absolute' if any(os.path.isabs(d) for d in x) else None),
INSTALL_MODE_KW.evolve(since='0.38.0'),
INSTALL_TAG_KW.evolve(since='0.60.0'),
)
def func_install_subdir(self, node: mparser.BaseNode, args: T.Tuple[str],
kwargs: 'kwargs.FuncInstallSubdir') -> build.InstallDir:

@ -292,6 +292,8 @@ CT_INSTALL_TAG_KW: KwargInfo[T.List[T.Union[str, bool]]] = KwargInfo(
convertor=lambda x: [y if isinstance(y, str) else None for y in x],
)
INSTALL_TAG_KW: KwargInfo[T.Optional[str]] = KwargInfo('install_tag', (str, NoneType))
INSTALL_KW = KwargInfo('install', bool, default=False)
CT_INSTALL_DIR_KW: KwargInfo[T.List[T.Union[str, bool]]] = KwargInfo(

Loading…
Cancel
Save