Skip to content

Commit

Permalink
create pcm actions for [headers] subtarget
Browse files Browse the repository at this point in the history
Reviewed By: milend

Differential Revision: D67149972

fbshipit-source-id: 542035bb5682b053c11f783a290695ed0ec13516
  • Loading branch information
rmaz authored and facebook-github-bot committed Dec 17, 2024
1 parent 56bd01f commit ec3363e
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions prelude/apple/swift/swift_pcm_compilation.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,27 @@ def get_swift_pcm_anon_targets(
uncompiled_deps: list[Dependency],
swift_cxx_args: list[str],
enable_cxx_interop: bool):
deps = [
{
deps = []
for uncompiled_dep in uncompiled_deps:
if SwiftPCMUncompiledInfo not in uncompiled_dep:
continue

# T209485965: workaround for depagg to avoid duplicate clang modules
# when traversing deps through the base target and [headers] subtarget.
# By always requesting the [headers] subtarget we should use the same
# anon actions for both paths.
if "headers" in uncompiled_dep[DefaultInfo].sub_targets:
uncompiled_dep = uncompiled_dep.sub_target("headers")

deps.append((_swift_pcm_compilation, {
"dep": uncompiled_dep,
"enable_cxx_interop": enable_cxx_interop,
"name": uncompiled_dep.label,
"swift_cxx_args": swift_cxx_args,
"_apple_toolchain": ctx.attrs._apple_toolchain,
}
for uncompiled_dep in uncompiled_deps
if SwiftPCMUncompiledInfo in uncompiled_dep
]
return [(_swift_pcm_compilation, d) for d in deps]
}))

return deps

def _compile_with_argsfile(
ctx: AnalysisContext,
Expand Down

0 comments on commit ec3363e

Please sign in to comment.