diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2018-01-13 21:24:48 +0000 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2018-01-15 20:28:25 +0000 |
commit | 57cb59787112aac395343e98f5cc4686560e74c9 (patch) | |
tree | 13e36a79fe6ed6a23efa0877af59cfc7783e74bb | |
parent | 3748f5465afd868d9b3aca89850e6775cc67ca14 (diff) | |
download | meson-57cb59787112aac395343e98f5cc4686560e74c9.zip meson-57cb59787112aac395343e98f5cc4686560e74c9.tar.gz meson-57cb59787112aac395343e98f5cc4686560e74c9.tar.bz2 |
Same for Vulkan
-rw-r--r-- | mesonbuild/dependencies/ui.py | 26 | ||||
-rw-r--r-- | test cases/common/174 dependency factory/meson.build | 5 |
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 |