aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/ui.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2023-01-29 13:48:22 -0500
committerEli Schwartz <eschwartz@archlinux.org>2023-06-26 13:10:33 -0400
commitb8b2d87567af8e7f556e290c3585e7ac462679b6 (patch)
tree8ee2b80546ceecccc5446ed8d89694778ae91c37 /mesonbuild/dependencies/ui.py
parentb1ddfabf8fbb0561a584bd7cfe2bb712b4105da2 (diff)
downloadmeson-b8b2d87567af8e7f556e290c3585e7ac462679b6.zip
meson-b8b2d87567af8e7f556e290c3585e7ac462679b6.tar.gz
meson-b8b2d87567af8e7f556e290c3585e7ac462679b6.tar.bz2
dependencies: switch the delayed-import mechanism for custom dependencies
Simply store the module it is expected to be found in. That module then appends to the packages dict, which guarantees mypy can verify that it's got the right type -- there is no casting needed.
Diffstat (limited to 'mesonbuild/dependencies/ui.py')
-rw-r--r--mesonbuild/dependencies/ui.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/mesonbuild/dependencies/ui.py b/mesonbuild/dependencies/ui.py
index f3879be..1dffa1f 100644
--- a/mesonbuild/dependencies/ui.py
+++ b/mesonbuild/dependencies/ui.py
@@ -29,6 +29,7 @@ from ..environment import detect_cpu_family
from .base import DependencyException, DependencyMethods, DependencyTypeName, SystemDependency
from .configtool import ConfigToolDependency
+from .detect import packages
from .factory import DependencyFactory
if T.TYPE_CHECKING:
@@ -136,6 +137,8 @@ class GnuStepDependency(ConfigToolDependency):
version = '1'
return version
+packages['gnustep'] = GnuStepDependency
+
class SDL2DependencyConfigTool(ConfigToolDependency):
@@ -187,6 +190,7 @@ class WxDependency(ConfigToolDependency):
raise DependencyException('wxwidgets module argument is not a string')
return candidates
+packages['wxwidgets'] = WxDependency
class VulkanDependencySystem(SystemDependency):
@@ -244,20 +248,20 @@ class VulkanDependencySystem(SystemDependency):
self.link_args.append(lib)
return
-gl_factory = DependencyFactory(
+packages['gl'] = gl_factory = DependencyFactory(
'gl',
[DependencyMethods.PKGCONFIG, DependencyMethods.SYSTEM],
system_class=GLDependencySystem,
)
-sdl2_factory = DependencyFactory(
+packages['sdl2'] = sdl2_factory = DependencyFactory(
'sdl2',
[DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL, DependencyMethods.EXTRAFRAMEWORK, DependencyMethods.CMAKE],
configtool_class=SDL2DependencyConfigTool,
cmake_name='SDL2',
)
-vulkan_factory = DependencyFactory(
+packages['vulkan'] = vulkan_factory = DependencyFactory(
'vulkan',
[DependencyMethods.PKGCONFIG, DependencyMethods.SYSTEM],
system_class=VulkanDependencySystem,