winevulkan: Allow running make_vulkan from any working directory.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2018-07-13 10:55:34 +02:00 committed by Alexandre Julliard
parent 27f2f4199f
commit cc0606175b
1 changed files with 7 additions and 0 deletions

View File

@ -2721,6 +2721,11 @@ class VkRegistry(object):
self.handles = sorted(handles, key=lambda handle: handle.name)
self.structs = sorted(structs, key=lambda struct: struct.name)
def set_working_directory():
path = os.path.abspath(__file__)
path = os.path.dirname(path)
os.chdir(path)
def download_vk_xml(filename):
url = "https://raw.github.com/KhronosGroup/Vulkan-Docs/v{0}/xml/vk.xml".format(VK_XML_VERSION)
if not os.path.isfile(filename):
@ -2738,6 +2743,8 @@ def main():
else: # > 1
LOGGER.setLevel(logging.DEBUG)
set_working_directory()
vk_xml = "vk-{0}.xml".format(VK_XML_VERSION)
download_vk_xml(vk_xml)
registry = VkRegistry(vk_xml)