build-system: introduce MODULE_DEFS_NEEDED list - #22561
Draft
maribu wants to merge 1 commit into
Draft
Conversation
- do not unconditionally expose every module `foo` via
`CFLAGS += -DMODULE_FOO`
- instead, only expose listed in `MODULE_DEFS_NEEDED`
- do so globally when listed in `Makefile.include`
- do so locally (only C files within the module) when listed in
`Makefile`
- modules listed in `MODULE_DEFS_NEEDED` will be added with
`CFLAGS += -DMODULE_FOO=1` if used, or `CFLAGS += -DMODULE_FOO=0` if
not used
- This makes `IS_USED()` pointless. In fact, it will even hide the
fact that a module is not listed in `MODULE_DEFS_NEEDED` but
tested for
- dreprecate `IS_USED()` and define it as `#define IS_USED(x) x` to
ensure missing `MODULE_DEFS_NEEDED` declarations cause compilation
errors
Murdock results❌ FAILED 4cda652 build-system: introduce
Build failures (21)
Artifacts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Contribution description
fooviaCFLAGS += -DMODULE_FOOMODULE_DEFS_NEEDEDMakefile.includeMakefileMODULE_DEFS_NEEDEDwill be added withCFLAGS += -DMODULE_FOO=1if used, orCFLAGS += -DMODULE_FOO=0if not usedIS_USED()pointless. In fact, it will even hide the fact that a module is not listed inMODULE_DEFS_NEEDEDbut tested forIS_USED()and define it as#define IS_USED(x) xto ensure missingMODULE_DEFS_NEEDEDdeclarations cause compilation errorsTesting procedure
Everything builds as before, same binaries as before.
Issues/PRs references
None
Declaration of AI-Tools / LLMs usage:
AI-Tools / LLMs that were used are:
MakefileandMakefile.includebased on instances ofMODULE_[A-Z0-9_]+in*.cand*.hwas mostly vibed