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

How do I set defines included through the toolchain? #306

Open
anthonymahshigian opened this issue Dec 3, 2024 · 1 comment
Open

How do I set defines included through the toolchain? #306

anthonymahshigian opened this issue Dec 3, 2024 · 1 comment

Comments

@anthonymahshigian
Copy link

Hello! Some macros such as UINT_MAX are defined in files through the toolchain. One example of this is clang's limits.h https://clang.llvm.org/doxygen/limits_8h_source.html

How can I make DWYU aware of these? Is it possible for it to be aware of the toolchain at all? If not, a suboptimal solution could be to do something like what is done for extra_ignore_include_paths where we hardcode a list of includes available. FWIW I've been hardcoding a subset of the defines I care about via a patch and it's worked fine for my use case, but if there is a better way to do this that would be ideal. The reason defines may matter is they affect which includes are used.

Thanks!

@martis42
Copy link
Owner

martis42 commented Dec 9, 2024

It is an open TODO to incorporate the Bazel C++ toolchain as source for which headers are available to the targets.

It is hard to come with a generic solution to all potential cases involving defines without hooking into the compiler itself (which this project actively decided against for better or worse). I might introduce an interface to hard code whatever defines a user wants to be always set 🤔 Can't promise anything concrete yet though.

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

2 participants