Add a _supported_ID function for modules #3907
Draft
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.
packages - add a _supported_ID function for modules:
If a scriptmodule has a _supported_MODULEID() function it will be called when the scriptmodule is added.
If the function returns 1, the module is not supported and will be disabled.
This can be used to do additional OS/GCC version checks.
Migrate the depends_* checks in dolphin, mame, ti99sim, lr-bsnes, lr-flycast-dev and lr-mame to supported* function.
This will disable the modules when the GCC is too old rather than throwing an error when trying to build
mysticmine - Disable on Debian versions newer than 10 (buster)
--
Some other modules could probably benefit from this (eg fs-uae) and maybe some I missed. I was originally going to handle this with some logic/comparisons in the module flags, but I think this is simpler and more flexible.
Needs some testing.