Skip to content

Commit 84d0bfd

Browse files
authored
Always link XCTestSwiftSupport into Swift test targets (#2697)
1 parent ea31fb6 commit 84d0bfd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

apple/internal/testing/apple_test_bundle_support.bzl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,22 @@ def _apple_test_bundle_impl(*, ctx, product_type):
353353
bundle_loader = None
354354

355355
extra_linkopts = [
356+
"-Xlinker",
357+
"-needed_framework",
358+
"-Xlinker",
359+
"XCTest",
356360
"-framework",
357361
"XCTest",
358362
"-bundle",
359363
]
364+
365+
if any([_is_swift_target(dep) for dep in ctx.attr.deps]):
366+
extra_linkopts.extend([
367+
"-Xlinker",
368+
"-needed-lXCTestSwiftSupport",
369+
"-lXCTestSwiftSupport",
370+
])
371+
360372
extra_link_inputs = []
361373

362374
if "apple.swizzle_absolute_xcttestsourcelocation" in features:

0 commit comments

Comments
 (0)