diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-01-08 15:39:33 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-01-29 09:11:24 -0800 |
commit | 0dbe9f6159b427d6688d3b1b39c08584889b6b48 (patch) | |
tree | 3927cd70665a71e1cb6dd53b2b816cd7e6da89fe /mesonbuild/dependencies/ui.py | |
parent | 773cc7b4b0540fd9a88d89f4179a3ffad11276ae (diff) | |
download | meson-0dbe9f6159b427d6688d3b1b39c08584889b6b48.zip meson-0dbe9f6159b427d6688d3b1b39c08584889b6b48.tar.gz meson-0dbe9f6159b427d6688d3b1b39c08584889b6b48.tar.bz2 |
dependencies: Use DependencyFactory for gl
Diffstat (limited to 'mesonbuild/dependencies/ui.py')
-rw-r--r-- | mesonbuild/dependencies/ui.py | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/mesonbuild/dependencies/ui.py b/mesonbuild/dependencies/ui.py index 016e324..02800b8 100644 --- a/mesonbuild/dependencies/ui.py +++ b/mesonbuild/dependencies/ui.py @@ -34,9 +34,9 @@ from .base import ExtraFrameworkDependency, PkgConfigDependency from .base import ConfigToolDependency, process_method_kw, DependencyFactory -class GLDependency(ExternalDependency): - def __init__(self, environment, kwargs): - super().__init__('gl', environment, kwargs) +class GLDependencySystem(ExternalDependency): + def __init__(self, name: str, environment, kwargs): + super().__init__(name, environment, kwargs) if self.env.machines[self.for_machine].is_darwin(): self.is_found = True @@ -51,19 +51,6 @@ class GLDependency(ExternalDependency): # FIXME: Detect version using self.clib_compiler return - @classmethod - def _factory(cls, environment, kwargs): - methods = process_method_kw(cls.get_methods(), kwargs) - candidates = [] - - if DependencyMethods.PKGCONFIG in methods: - candidates.append(functools.partial(PkgConfigDependency, 'gl', environment, kwargs)) - - if DependencyMethods.SYSTEM in methods: - candidates.append(functools.partial(GLDependency, environment, kwargs)) - - return candidates - @staticmethod def get_methods(): if mesonlib.is_osx() or mesonlib.is_windows(): @@ -652,6 +639,11 @@ class VulkanDependencySystem(ExternalDependency): def log_tried(self): return 'system' +gl_factory = DependencyFactory( + 'gl', + [DependencyMethods.PKGCONFIG, DependencyMethods.SYSTEM], + system_class=GLDependencySystem, +) vulkan_factory = DependencyFactory( 'vulkan', |