diff options
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', |