Skip to content

Commit 5d03018

Browse files
authored
Improve CcInfo parity with ObjcProvider (#184)
Beyond the initial done in #174, we also need to include 'headers' in the generated CcCompilationContext and return a CcInfo provider with our headermap generation rule.
1 parent 3195167 commit 5d03018

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

BazelExtensions/extensions.bzl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ module {module_name}.Swift {{
200200
)
201201

202202
compilation_context = cc_common.create_compilation_context(
203-
includes=depset([ctx.outputs.module_map.dirname]))
203+
headers=depset(provider_hdr),
204+
includes=depset([ctx.outputs.module_map.dirname]),
205+
)
204206

205207
providers.append(CcInfo(compilation_context=compilation_context))
206208
else:
@@ -346,12 +348,18 @@ def _make_headermap_impl(ctx):
346348
outputs=[ctx.outputs.headermap]
347349
)
348350

351+
compilation_context = cc_common.create_compilation_context(
352+
headers=depset([ctx.outputs.headermap]))
349353
objc_provider = apple_common.new_objc_provider(
350354
header=depset([ctx.outputs.headermap]),
351355
)
356+
352357
return struct(
353358
files=depset([ctx.outputs.headermap]),
354-
providers=[objc_provider],
359+
providers=[
360+
CcInfo(compilation_context=compilation_context),
361+
objc_provider,
362+
],
355363
objc=objc_provider,
356364
headers=depset([ctx.outputs.headermap]),
357365
)

0 commit comments

Comments
 (0)