Skip to content

Commit dd84137

Browse files
Skip xcode targets for compile targets with empty linking providers (#3316)
We have a rule extension that can cause swift_library to return an empty `CcInfo`. This change is needed to support that. Signed-off-by: Brentley Jones <github@brentleyjones.com>
1 parent 22dc989 commit dd84137

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

xcodeproj/automatic_target_info.bzl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,18 @@ def calculate_automatic_target_info(
457457

458458
xcode_targets = _DEFAULT_XCODE_TARGETS[this_target_type]
459459

460+
if (
461+
is_supported and
462+
not is_top_level and
463+
this_target_type == target_type.compile and
464+
CcInfo in target and
465+
not target[CcInfo].linking_context.linker_inputs
466+
):
467+
# Some repositories intentionally keep configuration-filtered compile
468+
# targets analyzable by returning empty linking providers such as
469+
# `CcInfo()`. Route those through the unsupported-target path early.
470+
is_supported = False
471+
460472
# Xcode doesn't support some source types that Bazel supports
461473
for attr in srcs:
462474
for file in getattr(ctx.rule.files, attr, []):

0 commit comments

Comments
 (0)