Skip to content

Commit b0177a9

Browse files
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.
1 parent 4a21dc6 commit b0177a9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/generate_source.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,15 @@ def main(argv):
4444
group.add_argument('-v', '--verify', action='store_true', help='verify repo files match generator output')
4545
args = parser.parse_args(argv)
4646

47+
registry = os.path.abspath(os.path.join(args.registry, 'vk.xml'))
48+
if not os.path.isfile(registry):
49+
registry = os.path.abspath(os.path.join(args.registry, 'Vulkan-Headers/registry/vk.xml'))
50+
if not os.path.isfile(registry):
51+
print(f'cannot find vk.xml in {args.registry}')
52+
return -1
53+
4754
gen_cmds = [[common_codegen.repo_relative('scripts/loader_genvk.py'),
48-
'-registry', os.path.abspath(os.path.join(args.registry, 'vk.xml')),
55+
'-registry', registry,
4956
'-quiet',
5057
filename] for filename in ['vk_layer_dispatch_table.h',
5158
'vk_loader_extensions.h',

0 commit comments

Comments
 (0)