Skip to content

Commit

Permalink
Fix framework imports with Swift modules
Browse files Browse the repository at this point in the history
With bazel 0.27.0 and the flip of `incompatible_objc_framework_cleanup`
bazelbuild/bazel#7944 framework imports of
Swift frameworks broke because the modules were included and processed
as module map files. This change makes them available in the build
but without processing them. They are handled automatically by clang /
swift since the framework is included using `-F`
  • Loading branch information
keith committed Jun 18, 2019
1 parent 9b3caf9 commit 465ea0e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions apple/internal/apple_framework_import.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,13 @@ def _classify_framework_imports(framework_imports):
# This matches /Headers/ and /PrivateHeaders/
header_imports.append(file)
continue
if "/Modules/" in file_short_path:
module_map_imports.append(file)
if file_short_path.endswith(".swiftmodule") or file_short_path.endswith(".swiftinterface"):
# Add Swift's module files to header_imports so that they are correctly included in the build
# by Bazel but they aren't processed in any way
header_imports.append(file)
continue
if file_short_path.endswith(".swiftdoc"):
# Ignore swiftdoc files, they don't matter in the build, only for IDEs
continue
bundling_imports.append(file)

Expand Down

0 comments on commit 465ea0e

Please sign in to comment.