From 2e3845ba4bc3ef33db04e5bcbc3e4a208641f92b Mon Sep 17 00:00:00 2001 From: Arjan Molenaar Date: Mon, 5 May 2025 11:59:36 +0200 Subject: vulkan: Make VK_SDK_PATH optional VULKAN_SDK is the preferred environment variable to point to the Vulkan installation. With this change the old variable (VK_SDK_PATH) is made optional. --- mesonbuild/dependencies/ui.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'mesonbuild/dependencies') diff --git a/mesonbuild/dependencies/ui.py b/mesonbuild/dependencies/ui.py index fc44037f1..a310362fa 100644 --- a/mesonbuild/dependencies/ui.py +++ b/mesonbuild/dependencies/ui.py @@ -187,12 +187,9 @@ class VulkanDependencySystem(SystemDependency): def __init__(self, name: str, environment: 'Environment', kwargs: T.Dict[str, T.Any], language: T.Optional[str] = None) -> None: super().__init__(name, environment, kwargs, language=language) - try: - self.vulkan_sdk = os.environ.get('VULKAN_SDK', os.environ['VK_SDK_PATH']) - if not os.path.isabs(self.vulkan_sdk): - raise DependencyException('VULKAN_SDK must be an absolute path.') - except KeyError: - self.vulkan_sdk = None + self.vulkan_sdk = os.environ.get('VULKAN_SDK', os.environ.get('VK_SDK_PATH')) + if self.vulkan_sdk and not os.path.isabs(self.vulkan_sdk): + raise DependencyException('VULKAN_SDK must be an absolute path.') if self.vulkan_sdk: # TODO: this config might not work on some platforms, fix bugs as reported -- cgit v1.2.3