-
Notifications
You must be signed in to change notification settings - Fork 12
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
Collect implementation_deps in compilation_context #16
base: master
Are you sure you want to change the base?
Conversation
compilation_context = target[CcInfo].compilation_context | ||
cc_infos = [target[CcInfo]] + _collect_cc_info(ctx) | ||
merged_cc_info = cc_common.merge_cc_infos(cc_infos = cc_infos) | ||
compilation_context = merged_cc_info.compilation_context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for dep in ctx.rule.attr.deps: | ||
if CcInfo in dep: | ||
cc_infos.append(dep[CcInfo]) | ||
if hasattr(ctx.rule.attr, "implementation_deps"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
before_each = "-Xiwyu", | ||
) | ||
|
||
args.add_all(["--mapping_file={}".format(m.path) for m in iwyu_mappings], before_each = "-Xiwyu") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Autoformatted by latest buildifier
@@ -95,7 +104,6 @@ def _toolchain_flags(ctx, is_cpp_target): | |||
unsupported_features = ctx.disabled_features, | |||
) | |||
|
|||
flags = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused assignment of flags
Hi! First of all thanks for the great tool :)
Combined with martis42/depend_on_what_you_use it's the best solution for removing transitive dependencies.
The
depend_on_what_you_use
(DWYU
) tool does the same thing asIWYU
but at aBUILD
file level.However, using the
fix-all
option of that tool does differentiate between regulardeps
andimplementation_deps
(bazel.build/c-cpp#cc_library_arg ->implementation_deps
).To make
bazel_iwyu
recognize the dependencies underimplementation_deps
, could you review this PR adding theimplementation_deps
to theCcInfo
context of the target?References: