Skip to content

Commit

Permalink
scripts: Make generate_source.py look harder for vk.xml
Browse files Browse the repository at this point in the history
Allow the registry path argument to also be the base directory
containing the Vulkan-Headers repo (eg. ./external) to save
redundant typing.
  • Loading branch information
jeremyg-lunarg committed Nov 5, 2024
1 parent 4a21dc6 commit b0177a9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scripts/generate_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,15 @@ def main(argv):
group.add_argument('-v', '--verify', action='store_true', help='verify repo files match generator output')
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

gen_cmds = [[common_codegen.repo_relative('scripts/loader_genvk.py'),
'-registry', os.path.abspath(os.path.join(args.registry, 'vk.xml')),
'-registry', registry,
'-quiet',
filename] for filename in ['vk_layer_dispatch_table.h',
'vk_loader_extensions.h',
Expand Down

0 comments on commit b0177a9

Please sign in to comment.