scripts: Better warning for getting reg.py

This commit is contained in:
Spencer Fricke 2024-09-12 13:53:28 -07:00
parent ea5774a13e
commit eb62fb38a5

View file

@ -25,7 +25,13 @@ def RunGenerators(api: str, registry: str, targetFilter: str) -> None:
scripts_directory_path = os.path.dirname(os.path.abspath(__file__))
registry_headers_path = os.path.join(scripts_directory_path, scripts)
sys.path.insert(0, registry_headers_path)
from reg import Registry
try:
from reg import Registry
except:
print("ModuleNotFoundError: No module named 'reg'") # normal python error message
print(f'{registry_headers_path} is not pointing to the Vulkan-Headers registry directory.')
print("Inside Vulkan-Headers there is a registry/reg.py file that is used.")
sys.exit(1) # Return without call stack so easy to spot error
from generators.base_generator import BaseGeneratorOptions
from generators.dispatch_table_generator import DispatchTableOutputGenerator