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/modules/gnome.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/modules/gnome.py')
-rw-r--r-- | mesonbuild/modules/gnome.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 4744b5a..230783a 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -2056,8 +2056,8 @@ class GnomeModule(ExtensionModule): ofile.write(package + '\n') return build.Data([mesonlib.File(True, outdir, fname)], install_dir, install_dir, mesonlib.FileMode(), state.subproject) - def _get_vapi_link_with(self, target: build.CustomTarget) -> T.List[T.Union[build.CustomTarget, build.CustomTargetIndex, build.SharedLibrary, build.StaticLibrary]]: - link_with: T.List[T.Union[build.StaticLibrary, build.SharedLibrary, build.CustomTarget, build.CustomTargetIndex]] = [] + def _get_vapi_link_with(self, target: build.CustomTarget) -> T.List[build.LibTypes]: + link_with: T.List[build.LibTypes] = [] for dep in target.get_target_dependencies(): if isinstance(dep, build.SharedLibrary): link_with.append(dep) @@ -2097,7 +2097,7 @@ class GnomeModule(ExtensionModule): inputs = kwargs['sources'] - link_with: T.List[T.Union[build.SharedLibrary, build.StaticLibrary, build.CustomTarget, build.CustomTargetIndex]] = [] + link_with: T.List[build.LibTypes] = [] for i in inputs: if isinstance(i, str): cmd.append(os.path.join(source_dir, i)) |