1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
|
# SPDX-License-Identifier: Apache-2.0
# Copyright © 2021 The Meson Developers
# Copyright © 2021 Intel Corporation
"""Keyword Argument type annotations."""
import typing as T
from typing_extensions import TypedDict, Literal
from .. import build
from .. import coredata
from ..mesonlib import MachineChoice, File, FileMode, FileOrString, OptionKey
from ..programs import ExternalProgram
class FuncAddProjectArgs(TypedDict):
"""Keyword Arguments for the add_*_arguments family of arguments.
including `add_global_arguments`, `add_project_arguments`, and their
link variants
Because of the use of a convertor function, we get the native keyword as
a MachineChoice instance already.
"""
native: MachineChoice
language: T.List[str]
class BaseTest(TypedDict):
"""Shared base for the Rust module."""
args: T.List[T.Union[str, File, build.Target]]
should_fail: bool
timeout: int
workdir: T.Optional[str]
depends: T.List[T.Union[build.CustomTarget, build.BuildTarget]]
priority: int
env: build.EnvironmentVariables
suite: T.List[str]
class FuncBenchmark(BaseTest):
"""Keyword Arguments shared between `test` and `benchmark`."""
protocol: Literal['exitcode', 'tap', 'gtest', 'rust']
class FuncTest(FuncBenchmark):
"""Keyword Arguments for `test`
`test` only adds the `is_prallel` argument over benchmark, so inherintance
is helpful here.
"""
is_parallel: bool
class ExtractRequired(TypedDict):
"""Keyword Arguments consumed by the `extract_required_kwargs` function.
Any function that uses the `required` keyword argument which accepts either
a boolean or a feature option should inherit it's arguments from this class.
"""
required: T.Union[bool, coredata.UserFeatureOption]
class ExtractSearchDirs(TypedDict):
"""Keyword arguments consumed by the `extract_search_dirs` function.
See the not in `ExtractRequired`
"""
dirs: T.List[str]
class FuncGenerator(TypedDict):
"""Keyword rguments for the generator function."""
arguments: T.List[str]
output: T.List[str]
depfile: T.Optional[str]
capture: bool
depends: T.List[T.Union[build.BuildTarget, build.CustomTarget]]
class GeneratorProcess(TypedDict):
"""Keyword Arguments for generator.process."""
preserve_path_from: T.Optional[str]
extra_args: T.List[str]
class DependencyMethodPartialDependency(TypedDict):
""" Keyword Arguments for the dep.partial_dependency methods """
compile_args: bool
link_args: bool
links: bool
includes: bool
sources: bool
class BuildTargeMethodExtractAllObjects(TypedDict):
recursive: bool
class FuncInstallSubdir(TypedDict):
install_dir: str
strip_directory: bool
exclude_files: T.List[str]
exclude_directories: T.List[str]
install_mode: FileMode
class FuncInstallData(TypedDict):
install_dir: str
sources: T.List[FileOrString]
rename: T.List[str]
install_mode: FileMode
class FuncInstallHeaders(TypedDict):
install_dir: T.Optional[str]
install_mode: FileMode
subdir: T.Optional[str]
class FuncInstallMan(TypedDict):
install_dir: T.Optional[str]
install_mode: FileMode
locale: T.Optional[str]
class FuncImportModule(ExtractRequired):
disabler: bool
class FuncIncludeDirectories(TypedDict):
is_system: bool
class FuncAddLanguages(ExtractRequired):
native: T.Optional[bool]
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]
|