Skip to content
Snippets Groups Projects
Commit 77f2bdd5 authored by Alexy Pellegrini's avatar Alexy Pellegrini
Browse files

generate_pyi: Propagate environment PATH variables to DLL directories

This facilitates .pyi generation when wrapping modules with dependencies.
parent 32c4d79c
No related branches found
No related tags found
No related merge requests found
......@@ -623,6 +623,15 @@ def main(argv=sys.argv):
# the module is definitely an extension module
modules.append(modname)
# Give all PATH environment variable entries to add_dll_directory on Windows
# This enable third-party libraries like OpenXR loader's DLL to be found easily.
if os.name == "nt":
for p in os.environ.get("PATH").split(';'):
try:
os.add_dll_directory(p)
except Exception as e:
print(f"Warning: Failed to add {p} as DLL search directory: ${e}")
# iterate through the modules in the package
errflag = False
for modname in modules:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment