Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core Gradle header dependencies doesn't account for #undef of macros #862

Open
lacasseio opened this issue May 5, 2024 · 0 comments
Open

Comments

@lacasseio
Copy link
Member

lacasseio commented May 5, 2024

As part of Gradle's core mechanic, the header dependency graph doesn't account for undefined macros. These are especially important in preprocessor libraries (like Boost). This doesn't mean we should necessarily support tracking of (un)defined macros, but we need to be aware that #include SOME_MACRO may mean different files depending on the macro context. At the moment, Gradle core mechanic will discover the potentially multiple definitions of SOME_MACRO, but only the first definition will be considered when resolving the include. The first definition may vary depending on previously visited headers (see the other issue). The graph may be slightly wrong because macros can be undefined, and some headers are designed to be included multiple times (see the other issue). Gradle header graph discovery is not meant to be 100% accurate, but only good enough so the task can be deemed out-of-date/up-to-date when required and cached.

One strategy we may opt for is simply resolving the include out of all the known definitions of SOME_MACRO. Gradle uses this strategy currently. If that strategy is good enough, we should document the behaviour better with examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant