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

@ -19,6 +19,10 @@ def can_build():
return os.path.exists(get_env_android_sdk_root())
def get_tools(env: "SConsEnvironment"):
return ["clang", "clang++", "as", "ar", "link"]
def get_opts():
from SCons.Variables import BoolVariable