Skip to content

Commit

Permalink
Ensure -import-underlying-module gets into the generated Xcode project (
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagohmcruz authored Jan 4, 2024
1 parent 883cc85 commit 8c7513d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rules/legacy_xcodeproj.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ def _xcodeproj_aspect_collect_swift_copts(deps, ctx):
copts = None
if ctx.rule.kind == "swift_library":
copts = _make_swift_copts(deps)

# Ensures `-import-underlying-module` gets into the generated Xcode project if applied,
# otherwise indexing might fail in mixed modules
# https://github.com/bazel-ios/rules_ios/blob/883cc859daffb1f02bd0e153fca39177d2fa7eb4/rules/library.bzl#L923
if hasattr(ctx.rule.attr, "copts"):
if "-import-underlying-module" in ctx.rule.attr.copts:
copts += ["-import-underlying-module"]
else:
for dep in deps:
if _SrcsInfo in dep:
Expand Down

0 comments on commit 8c7513d

Please sign in to comment.