summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2024-01-26 13:18:26 +0100
committerGitHub <noreply@github.com>2024-01-26 13:18:26 +0100
commit17e7f85c06366b427e5068c5b3e2940e27ff5f1d (patch)
tree1ca7ef65a4676c23c057260d25226cdf3835d2f0
parent99ac3d332ac8aec3ef93b13e8aa9755da667efb0 (diff)
parentb4e519b07f37c8a3e8d2282df085e059cbf87d4b (diff)
downloadredot-engine-17e7f85c06366b427e5068c5b3e2940e27ff5f1d.tar.gz
Merge pull request #87609 from akien-mga/scons-d3d12-install-fix-linux-support
SCons: Fix Windows cross-compilation from Linux after #86717
-rw-r--r--misc/scripts/install_d3d12_sdk_windows.py8
-rw-r--r--platform/windows/detect.py17
2 files changed, 22 insertions, 3 deletions
diff --git a/misc/scripts/install_d3d12_sdk_windows.py b/misc/scripts/install_d3d12_sdk_windows.py
index 0995aa734f..8cfa1d399b 100644
--- a/misc/scripts/install_d3d12_sdk_windows.py
+++ b/misc/scripts/install_d3d12_sdk_windows.py
@@ -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"
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index 7fd314c7ce..b1dd66ca48 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -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),