Same for Vulkan

pull/2926/head
Jon Turney 7 years ago
parent 3748f5465a
commit 57cb597871
  1. 26
      mesonbuild/dependencies/ui.py
  2. 5
      test cases/common/174 dependency factory/meson.build

@ -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]

@ -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

Loading…
Cancel
Save