From a63c5d4615715e9afb5425387624f3a53c5d5060 Mon Sep 17 00:00:00 2001 From: Jeremy Gebben Date: Tue, 5 Nov 2024 08:42:11 -0700 Subject: [PATCH] scripts: Make generate_source.py look harder for vk.xml Allow the registry path argument to also be the base directory containing the Vulkan-Headers repo (eg. ./external) to save redundant typing. --- scripts/generate_source.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/generate_source.py b/scripts/generate_source.py index ee9fc36..01cf652 100755 --- a/scripts/generate_source.py +++ b/scripts/generate_source.py @@ -163,6 +163,12 @@ def main(argv): args = parser.parse_args(argv) registry = os.path.abspath(os.path.join(args.registry, 'vk.xml')) + if not os.path.isfile(registry): + registry = os.path.abspath(os.path.join(args.registry, 'Vulkan-Headers/registry/vk.xml')) + if not os.path.isfile(registry): + print(f'cannot find vk.xml in {args.registry}') + return -1 + RunGenerators(args.api, registry, args.target) return 0