Merge pull request #87609 from akien-mga/scons-d3d12-install-fix-linux-support

SCons: Fix Windows cross-compilation from Linux after #86717
This commit is contained in:
Rémi Verschelde 2024-01-26 13:18:26 +01:00 committed by GitHub
commit 17e7f85c06
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 3 deletions

View file

@ -5,7 +5,13 @@ import urllib.request
import shutil
# Base Godot dependencies path
deps_folder = os.path.join(f"{os.getenv('LOCALAPPDATA')}", "Godot", "build_deps")
# If cross-compiling (no LOCALAPPDATA), we install in `bin`
deps_folder = os.getenv("LOCALAPPDATA")
if deps_folder:
deps_folder = os.path.join(deps_folder, "Godot", "build_deps")
else:
deps_folder = os.path.join("bin", "build_deps")
# DirectX Shader Compiler
dxc_version = "v1.7.2308"
dxc_filename = "dxc_2023_08_14.zip"

View file

@ -164,8 +164,21 @@ def get_opts():
mingw = os.getenv("MINGW_PREFIX", "")
# Direct3D 12 SDK dependencies folder
d3d12_deps_folder = os.path.join(os.getenv("LOCALAPPDATA"), "Godot", "build_deps")
# Direct3D 12 SDK dependencies folder.
d3d12_deps_folder = os.getenv("LOCALAPPDATA")
if d3d12_deps_folder:
d3d12_deps_folder = os.path.join(d3d12_deps_folder, "Godot", "build_deps")
else:
# Cross-compiling, the deps install script puts things in `bin`.
# Getting an absolute path to it is a bit hacky in Python.
try:
import inspect
caller_frame = inspect.stack()[1]
caller_script_dir = os.path.dirname(os.path.abspath(caller_frame[1]))
d3d12_deps_folder = os.path.join(caller_script_dir, "bin", "build_deps")
except: # Give up.
d3d12_deps_folder = ""
return [
("mingw_prefix", "MinGW prefix", mingw),