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

SCons: Fix handling of platform-specific tools, notably mingw

Add optional `detect.py` `get_tools` method to let platforms register SCons
tools they need.

This helps move this logic out of SConstruct, keeping platforms more self
contained, and helping thirdparty platforms define their own custom tools.

This logic was also unreliable (the `use_mingw` one would only work if
passed manually on the command line, not in e.g. `get_flags`).

Co-authored-by: Thaddeus Crews <repiteo@outlook.com>
This commit is contained in:
Rémi Verschelde
2025-01-25 13:59:30 +01:00
parent b15b24b087
commit 90208f7dd4
4 changed files with 41 additions and 34 deletions

View File

@@ -28,6 +28,11 @@ def can_build():
return WhereIs("emcc") is not None
def get_tools(env: "SConsEnvironment"):
# Use generic POSIX build toolchain for Emscripten.
return ["cc", "c++", "ar", "link", "textfile", "zip"]
def get_opts():
from SCons.Variables import BoolVariable