diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-08-04 20:02:53 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2022-08-04 20:06:01 -0400 |
commit | 37f95303f09209ff6d9652a17354bc4dceecb32f (patch) | |
tree | 35444fbd131ffb2a103f5f13576987d67d8a8ea2 /mesonbuild/build.py | |
parent | 7c320e60f1afcb9c0ea7ec68e29842266c775a43 (diff) | |
download | meson-37f95303f09209ff6d9652a17354bc4dceecb32f.zip meson-37f95303f09209ff6d9652a17354bc4dceecb32f.tar.gz meson-37f95303f09209ff6d9652a17354bc4dceecb32f.tar.bz2 |
typing: simplify type annotations for libraries
In a bunch of places we need to list various types of libraries
including custom_target outputs, and it gets very long. Use a common
T.Union for this.
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r-- | mesonbuild/build.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 98e3c93..c626ce5 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -57,6 +57,7 @@ if T.TYPE_CHECKING: from .mparser import BaseNode GeneratedTypes = T.Union['CustomTarget', 'CustomTargetIndex', 'GeneratedList'] + LibTypes = T.Union['SharedLibrary', 'StaticLibrary', 'CustomTarget', 'CustomTargetIndex'] pch_kwargs = {'c_pch', 'cpp_pch'} @@ -755,7 +756,7 @@ class BuildTarget(Target): self.external_deps: T.List[dependencies.Dependency] = [] self.include_dirs: T.List['IncludeDirs'] = [] self.link_language = kwargs.get('link_language') - self.link_targets: T.List[T.Union[SharedLibrary, StaticLibrary, 'CustomTarget', 'CustomTargetIndex']] = [] + self.link_targets: T.List[LibTypes] = [] self.link_whole_targets: T.List[T.Union[StaticLibrary, CustomTarget, CustomTargetIndex]] = [] self.link_depends = [] self.added_deps = set() |