I have a "Objective-C" Framework that is mostly Swift based except for the primary headerfile. Because you cannot use a bridging header within the framework, somewhere I discovered the "trick" of using a "module.modulemap" file to expose some ObjectiveC based interfaces to the Swift code:
module ReachabilityPrivate { header "../../ThirdParty/Reachability/Reachability.h" export * } ...
After doing this for a long time, for some reason we find that when "import MyFramework" is exposed to Swift files within the App itself, those files won't complile now due to
error: missing required modules: 'ReachabilityPrivate', ...
My framework has the "Defines Module Maps" set to yes, and neither of the two modulemap files defined in Build Settings. In this case, Xcode creates a modulemap for my framwork:
framework module MyFramework { umbrella header "MyFramework.h" export * module * { export * } } module MyFramework.Swift { header "MyFramework-Swift.h" requires objc }
I've read the Clang page on modulemaps but I cannot discover the concept of nested modulemaps. Then, not really knowing what I was doing, I tried to play with what appear to be the free variables available to me:
- use a module.modulemap file along with a module.private.modulemap file
- define one or both of the "Module Map File" and "Private Module Map File"
- within a provided "Module Map File", delete the line "module * { export * }", which I guess is the root cause of all my problems
- try various combinations of the above
But, no matter what I try, I now get some form of build error just trying to build the framework making it impossible to see any affect on the primary app.
One of my coworkers has much more experience with modulemaps and he has no suggestions for resolving this - thus my post here!