Skip to content

Commit

Permalink
Improve CcInfo parity with ObjcProvider
Browse files Browse the repository at this point in the history
Beyond the initial done in bazel-xcode#174, we also need to include 'headers' in
the generated CcCompilationContext and return a CcInfo provider with our
headermap generation rule.
  • Loading branch information
jparise committed Sep 7, 2021
1 parent db17580 commit cc9d862
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions BazelExtensions/extensions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ module {module_name}.Swift {{
)

compilation_context = cc_common.create_compilation_context(
includes=depset([ctx.outputs.module_map.dirname]))
headers=depset(provider_hdr),
includes=depset([ctx.outputs.module_map.dirname]),
)

providers.append(CcInfo(compilation_context=compilation_context))
else:
Expand Down Expand Up @@ -346,12 +348,18 @@ def _make_headermap_impl(ctx):
outputs=[ctx.outputs.headermap]
)

compilation_context = cc_common.create_compilation_context(
headers=depset([ctx.outputs.headermap]))
objc_provider = apple_common.new_objc_provider(
header=depset([ctx.outputs.headermap]),
)

return struct(
files=depset([ctx.outputs.headermap]),
providers=[objc_provider],
providers=[
CcInfo(compilation_context=compilation_context),
objc_provider,
],
objc=objc_provider,
headers=depset([ctx.outputs.headermap]),
)
Expand Down

0 comments on commit cc9d862

Please sign in to comment.