diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2025-01-10 12:10:59 -0800 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2025-10-15 10:21:46 -0700 |
| commit | a316fdd29ad9217463b1fdf62df4709158f2af21 (patch) | |
| tree | af54f1ff90355d312d88ca5ec17eb7d6193a96de | |
| parent | e621f61a7c572687483c5a4660645636278b3d68 (diff) | |
| download | meson-a316fdd29ad9217463b1fdf62df4709158f2af21.tar.gz | |
build: use a TypedDict for StaticLibrary kwargs
| -rw-r--r-- | mesonbuild/build.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 794e8cb1c..27b4abf0d 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -128,6 +128,12 @@ if T.TYPE_CHECKING: soversion: str darwin_versions: T.Tuple[str, str] + class StaticLibraryKeywordArguments(BuildTargetKeywordArguments, total=False): + + pic: bool + prelink: bool + rust_abi: T.Optional[RustAbi] + DEFAULT_STATIC_LIBRARY_NAMES: T.Mapping[str, T.Tuple[str, str]] = { 'unix': ('lib', 'a'), 'windows': ('', 'lib'), @@ -142,7 +148,6 @@ DEFAULT_SHARED_LIBRARY_NAMES: T.Mapping[str, T.Tuple[str, str, str]] = { 'cygwin': ('cyg', 'dll', 'dll.a'), } - pch_kwargs = {'c_pch', 'cpp_pch'} lang_arg_kwargs = {f'{lang}_args' for lang in all_languages} @@ -2358,8 +2363,8 @@ class StaticLibrary(BuildTarget): objects: T.List[ObjectTypes], environment: environment.Environment, compilers: T.Dict[str, 'Compiler'], - kwargs): - self.prelink = T.cast('bool', kwargs.get('prelink', False)) + kwargs: StaticLibraryKeywordArguments): + self.prelink = kwargs.get('prelink', False) super().__init__(name, subdir, subproject, for_machine, sources, structured_sources, objects, environment, compilers, kwargs) @@ -2446,7 +2451,7 @@ class StaticLibrary(BuildTarget): def type_suffix(self): return "@sta" - def process_kwargs(self, kwargs): + def process_kwargs(self, kwargs: StaticLibraryKeywordArguments) -> None: super().process_kwargs(kwargs) rust_abi = kwargs.get('rust_abi') |
