SCons: Add optional detect.py
get_tools
method to let platforms register custom tools
#99762
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
orcustom.py
).Draft for now as this requires some testing on affected platforms, and validation of the use case I have in W4 for thirdparty platforms setting their own tools.
Our overall set of custom tools registered for first-party platforms is something that might be worth reviewing over time. The Windows
mingw
stuff is still pretty hacky, and there's a strayenv.Tools("msvc")
for Windows which we might want to do differently. And some platforms overrideCC
,CXX
, etc. manually when we might be able to rely on pre-existing SCons tools to do it properly. As always, such changes have a high risk of regression though so we'd need to be careful with testing.