1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Merge pull request #109912 from Repiteo/ci/d3d12-dependency-fix

CI: Fix detection of Windows D3D12 dependencies
This commit is contained in:
Thaddeus Crews
2025-08-24 14:23:05 -05:00

View File

@@ -1,5 +1,9 @@
#!/usr/bin/env python #!/usr/bin/env python
if __name__ != "__main__":
raise SystemExit(f'Utility script "{__file__}" should not be used as a module!')
import argparse
import os import os
import shutil import shutil
import subprocess import subprocess
@@ -10,6 +14,14 @@ sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "../
from misc.utility.color import Ansi, color_print from misc.utility.color import Ansi, color_print
parser = argparse.ArgumentParser(description="Install D3D12 dependencies for Windows platforms.")
parser.add_argument(
"--mingw_prefix",
default=os.getenv("MINGW_PREFIX", ""),
help="Explicitly specify a path containing the MinGW bin folder.",
)
args = parser.parse_args()
# Base Godot dependencies path # Base Godot dependencies path
# If cross-compiling (no LOCALAPPDATA), we install in `bin` # If cross-compiling (no LOCALAPPDATA), we install in `bin`
deps_folder = os.getenv("LOCALAPPDATA") deps_folder = os.getenv("LOCALAPPDATA")
@@ -74,10 +86,11 @@ print("Mesa NIR installed successfully.\n")
# MinGW needs DLLs converted with dlltool. # MinGW needs DLLs converted with dlltool.
# We rely on finding gendef/dlltool to detect if we have MinGW. # We rely on finding gendef/dlltool to detect if we have MinGW.
# Check existence of needed tools for generating mingw library. # Check existence of needed tools for generating mingw library.
gendef = shutil.which("gendef") or "" pathstr = os.environ.get("PATH", "")
dlltool = shutil.which("dlltool") or "" if args.mingw_prefix:
if dlltool == "": pathstr = os.path.join(args.mingw_prefix, "bin") + os.pathsep + pathstr
dlltool = shutil.which("x86_64-w64-mingw32-dlltool") or "" gendef = shutil.which("x86_64-w64-mingw32-gendef", path=pathstr) or shutil.which("gendef", path=pathstr) or ""
dlltool = shutil.which("x86_64-w64-mingw32-dlltool", path=pathstr) or shutil.which("dlltool", path=pathstr) or ""
has_mingw = gendef != "" and dlltool != "" has_mingw = gendef != "" and dlltool != ""
color_print(f"{Ansi.BOLD}[2/3] WinPixEventRuntime") color_print(f"{Ansi.BOLD}[2/3] WinPixEventRuntime")
@@ -107,7 +120,9 @@ if has_mingw:
) )
os.chdir(cwd) os.chdir(cwd)
else: else:
print("MinGW wasn't found, so only MSVC support is provided for WinPixEventRuntime.") print(
'MinGW support requires "dlltool" and "gendef" dependencies, so only MSVC support is provided for WinPixEventRuntime. Did you forget to provide a `--mingw_prefix`?'
)
print(f"WinPixEventRuntime {pix_version} installed successfully.\n") print(f"WinPixEventRuntime {pix_version} installed successfully.\n")
# DirectX 12 Agility SDK # DirectX 12 Agility SDK