aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/ui.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-06-13 21:25:29 -0700
committerDylan Baker <dylan@pnwbakers.com>2021-06-14 09:09:32 -0700
commit0412bdd7535ec8d8d314f5ecf6120472534764ba (patch)
tree0fe86e702eff81f39b1cd80a4744c0f251e2104a /mesonbuild/dependencies/ui.py
parent203a548d60343a97e436b59aa026ce17597f1cd1 (diff)
downloadmeson-0412bdd7535ec8d8d314f5ecf6120472534764ba.zip
meson-0412bdd7535ec8d8d314f5ecf6120472534764ba.tar.gz
meson-0412bdd7535ec8d8d314f5ecf6120472534764ba.tar.bz2
dependencies: Use a typing.NewType for Dependency.type_name
This allow mypy to catch cases where we accidently assign the dependency name to the type_name, as it sees them as having different types (though at runtime they're all strings).
Diffstat (limited to 'mesonbuild/dependencies/ui.py')
-rw-r--r--mesonbuild/dependencies/ui.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/dependencies/ui.py b/mesonbuild/dependencies/ui.py
index 53ae589..1646ddf 100644
--- a/mesonbuild/dependencies/ui.py
+++ b/mesonbuild/dependencies/ui.py
@@ -25,7 +25,7 @@ from ..mesonlib import (
)
from ..environment import detect_cpu_family
-from .base import DependencyException, DependencyMethods
+from .base import DependencyException, DependencyMethods, DependencyTypeName
from .configtool import ConfigToolDependency
from .factory import DependencyFactory
from .system import SystemDependency
@@ -233,7 +233,8 @@ class VulkanDependencySystem(SystemDependency):
if not os.path.isfile(header):
raise DependencyException('VULKAN_SDK point to invalid directory (no include)')
- self.type_name = 'vulkan_sdk'
+ # XXX: this is very odd, and may deserve being removed
+ self.type_name = DependencyTypeName('vulkan_sdk')
self.is_found = True
self.compile_args.append('-I' + inc_path)
self.link_args.append('-L' + lib_path)
@@ -246,7 +247,6 @@ class VulkanDependencySystem(SystemDependency):
# simply try to guess it, usually works on linux
libs = self.clib_compiler.find_library('vulkan', environment, [])
if libs is not None and self.clib_compiler.has_header('vulkan/vulkan.h', '', environment, disable_cache=True)[0]:
- self.type_name = 'system'
self.is_found = True
for lib in libs:
self.link_args.append(lib)