diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2021-08-10 20:07:39 -0700 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2021-09-30 21:01:38 +0200 |
commit | c3c30d4b060239654c9b848092692ab346ebed9d (patch) | |
tree | 52b2ebd5e5c788fb529dac1717051093311ca255 /mesonbuild/interpreter/kwargs.py | |
parent | bb706231bd3bfd8983f1a5df24111efe1ad0734d (diff) | |
download | meson-c3c30d4b060239654c9b848092692ab346ebed9d.zip meson-c3c30d4b060239654c9b848092692ab346ebed9d.tar.gz meson-c3c30d4b060239654c9b848092692ab346ebed9d.tar.bz2 |
interpreter: Use typed_kwargs for func_custom_target
This does not convert the build side, or remove any of the checking it
does. We still need that for other callers of custom target. What we'll
do for those is add an internal interface that defaults things, then
we'll be able to have those callers do their own validation, and the
CustomTarget validation machinary can be removed.
Fixes #9096
Diffstat (limited to 'mesonbuild/interpreter/kwargs.py')
-rw-r--r-- | mesonbuild/interpreter/kwargs.py | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/mesonbuild/interpreter/kwargs.py b/mesonbuild/interpreter/kwargs.py index 4281ee4..2229984 100644 --- a/mesonbuild/interpreter/kwargs.py +++ b/mesonbuild/interpreter/kwargs.py @@ -10,7 +10,7 @@ from typing_extensions import TypedDict, Literal from .. import build from .. import coredata -from ..mesonlib import MachineChoice, File, FileMode, FileOrString +from ..mesonlib import MachineChoice, File, FileMode, FileOrString, OptionKey from ..programs import ExternalProgram @@ -162,3 +162,27 @@ class RunTarget(TypedDict): command: T.List[T.Union[str, build.BuildTarget, build.CustomTarget, ExternalProgram, File]] depends: T.List[T.Union[build.BuildTarget, build.CustomTarget]] env: build.EnvironmentVariables + + +class CustomTarget(TypedDict): + + build_always: bool + build_always_stale: bool + build_by_default: bool + capture: bool + command: T.List[T.Union[str, build.BuildTarget, build.CustomTarget, + build.CustomTargetIndex, ExternalProgram, File]] + consonle: bool + depend_files: T.List[FileOrString] + depends: T.List[T.Union[build.BuildTarget, build.CustomTarget]] + depfile: T.Optional[str] + env: build.EnvironmentVariables + feed: bool + input: T.List[T.Union[str, build.BuildTarget, build.CustomTarget, build.CustomTargetIndex, + build.ExtractedObjects, build.GeneratedList, ExternalProgram, File]] + install: bool + install_dir: T.List[T.Union[str, bool]] + install_mode: FileMode + install_tag: T.List[T.Union[str, bool]] + output: T.List[str] + override_options: T.Dict[OptionKey, str] |