aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/dependencies/ui.py26
-rw-r--r--test cases/common/174 dependency factory/meson.build5
2 files changed, 17 insertions, 14 deletions
diff --git a/mesonbuild/dependencies/ui.py b/mesonbuild/dependencies/ui.py
index f1ee738..a6307c4 100644
--- a/mesonbuild/dependencies/ui.py
+++ b/mesonbuild/dependencies/ui.py
@@ -449,20 +449,6 @@ class VulkanDependency(ExternalDependency):
def __init__(self, environment, kwargs):
super().__init__('vulkan', environment, None, kwargs)
- if DependencyMethods.PKGCONFIG in self.methods:
- try:
- pcdep = PkgConfigDependency('vulkan', environment, kwargs)
- if pcdep.found():
- self.type_name = 'pkgconfig'
- self.is_found = True
- self.compile_args = pcdep.get_compile_args()
- self.link_args = pcdep.get_link_args()
- self.version = pcdep.get_version()
- self.pcdep = pcdep
- return
- except Exception:
- pass
-
if DependencyMethods.SYSTEM in self.methods:
try:
self.vulkan_sdk = os.environ['VULKAN_SDK']
@@ -519,6 +505,18 @@ class VulkanDependency(ExternalDependency):
self.link_args.append(lib)
return
+ @classmethod
+ def _factory(cls, environment, kwargs):
+ if DependencyMethods.PKGCONFIG in cls._process_method_kw(kwargs):
+ try:
+ pcdep = PkgConfigDependency('vulkan', environment, kwargs)
+ if pcdep.found():
+ return pcdep
+ except Exception:
+ pass
+
+ return VulkanDependency(environment, kwargs)
+
@staticmethod
def get_methods():
return [DependencyMethods.PKGCONFIG, DependencyMethods.SYSTEM]
diff --git a/test cases/common/174 dependency factory/meson.build b/test cases/common/174 dependency factory/meson.build
index 46d060a..d564467 100644
--- a/test cases/common/174 dependency factory/meson.build
+++ b/test cases/common/174 dependency factory/meson.build
@@ -14,3 +14,8 @@ dep = dependency('SDL2', method: 'config-tool', required: false)
if dep.found() and dep.type_name() == 'configtool'
dep.get_configtool_variable('prefix')
endif
+
+dep = dependency('Vulkan', method: 'pkg-config', required: false)
+if dep.found() and dep.type_name() == 'pkgconfig'
+ dep.get_pkgconfig_variable('prefix')
+endif