-
Notifications
You must be signed in to change notification settings - Fork 6
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
Comments
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. |
@anthonymahshigian I imaging you would create a config for executing DWYU in your For now I don't intend to add a new feature to the DWYU aspect for hard coding a list of defines, as this is already possible today with existing features and standard Bazel. That much said, ideally DWYU would be able to give For now I will keep this issue open in case further discussion is required and this solution does not allow you to hard code defines more elegantly until a full toolchain support is done. |
Hello! Some macros such as
UINT_MAX
are defined in files through the toolchain. One example of this is clang'slimits.h
https://clang.llvm.org/doxygen/limits_8h_source.htmlHow 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!
The text was updated successfully, but these errors were encountered: