@@ -1436,17 +1436,21 @@ public final class MixedTargetBuildDescription {
1436
1436
// When the Swift compiler creates the generated interop header for
1437
1437
// Objective-C compatible Swift API (via `-emit-objc-header`), any
1438
1438
// Objective-C symbol that cannot be forward declared (e.g. superclass,
1439
- // protocol, etc.) will attempt to be imported via a module import of
1440
- // the module's umbrella header (e.g. `#import <Module/Module.h>`). The
1441
- // Swift compiler assumes (1) the module has the structure of a
1442
- // framework and (2) that an umbrella header exists. However, SwiftPM
1443
- // does not build frameworks (breaking assumption #1) and an umbrella
1444
- // header may not exist (breaking assumption #2). Instead, to guarantee
1445
- // the generated interop header's import can be resolved, the package
1446
- // manager generates an umbrella header if needed and will later use a
1447
- // VFS overlay to make the generated header appear in the proper
1448
- // location so the problematic import in the generated interop header
1449
- // can be resolved during the build.
1439
+ // protocol, etc.) will attempt to be imported via a bridging header.
1440
+ // Unfortunately, a custom bridging header can not be specified because
1441
+ // the target is evaluated as a framework target (as opposed to an app
1442
+ // target), and framework target do not support bridging headers. So,
1443
+ // the compiler defaults to importing the following in the generated
1444
+ // interop header ($(ModuleName)-Swift.h):
1445
+ //
1446
+ // #import <$(ModuleName)/$(ModuleName).h>
1447
+ //
1448
+ // The compiler assumes that the above path can be resolved. Instead of
1449
+ // forcing package authors to structure their packages around that
1450
+ // constraint, the package manager generates an umbrella header if
1451
+ // needed and will later use a VFS overlay to make the generated header
1452
+ // appear in the proper location so the bridging header import in the
1453
+ // generated interop header can be resolved during the build.
1450
1454
var generatedUmbrellaHeaderPath : AbsolutePath ? = nil
1451
1455
let relativeUmbrellaHeaderPath =
1452
1456
RelativePath ( " \( mixedTarget. c99name) / \( mixedTarget. c99name) .h " )
0 commit comments