-
Notifications
You must be signed in to change notification settings - Fork 189
Swift does not import underlying module #92
Comments
Ok so interestingly enough, I think I figured out a little bit more about this. And both are intricacies with CocoaPods and how it generates dynamic frameworks. So there are a few parts to this. First CocoaPods includes a Second in the generated umbrella headers, CocoaPods also imports And lastly the generated I'm not sure what the "right" solution to these problems are. I think first of all, CocoaPods shouldn't be doing any of these things unless absolutely necessary. Unfortunately I think with some static library configurations it becomes difficult to determine whether or not it is necessary. For example But I assume the issue that sparked this conversation as it relates to |
It looks like xcbuild only passes the |
It looks like |
OK, I was able to reproduce the issue in a sample Swift framework. Modifying the xcbuild command line to include |
It seems like it only applies to our frameworks. I did not have to add any imports to the main target, only its framework dependencies. Also probably applies because CocoaPods is overzealous about adding those imports, so it would make sense to be a frameworks problem. |
I just created an empty framework project in Xcode and it had |
I think in an ideal scenario, we wouldn't have that UIKit import in there as it seems like that unnecessarily pollutes the namespace. I removed a few of those locally to see what kind of imports we were missing and that was definitely part of it.. |
…92. Frameworks expect that their underlying Objective-C module is available in Swift without an explicit bridging header. In order to support that, a custom module map is needed at build time and an additional flag tells the Swift compiler to import the underlying module automatically.
OK, I updated #93 with a bunch of changes that implement the missing pieces to make this work. It works on my super basic test project, but it'd be awesome if you could let me know if it fixes this for you too. |
…92. Frameworks expect that their underlying Objective-C module is available in Swift without an explicit bridging header. In order to support that, a custom module map is needed at build time and an additional flag tells the Swift compiler to import the underlying module automatically.
Split out of #88.
@keith wrote:
@keith wrote:
@grp wrote:
The text was updated successfully, but these errors were encountered: