Hi,
I'm running into issues compiling my project in Xcode and seeking some help.
Let's assume the following dependency graph:
iOS App > Dynamic iOS framework > Static XCFramework with Obj-C module map and headers
If I transform that graph into the following by generating an XCFramework off the dynamic framework:
iOS App > Dynamic XCFramework
The app doesn't understandably compile because it can't find the transitive module. This is solvable by using @_implementationOnly import
, but in this particular scenario it's not possible, so I'm trying to figure out how to set the right build settings in the iOS App
target to make it compile. In particular. I've set the following ones:
- Other Swift Flags:
-Xcc -fmodule-map-file={path-to-static-xcframework-modulemap}
- Other C Flags:
-fmodule-map-file={path-to-static-xcframework-modulemap}
- Header search paths:
{path-to-static-xcframework-headers}
Unfortunately, that leads to another compilation issue when it tries to compile the umbrella header of the module. The modulemap of the transitive XCFramework looks like this:
framework module TransitiveModule {
umbrella header "TransitiveModule.h"
export *
module * { export * }
But when it tries to compile TransitiveModule.h
, it fails when compiling the imports with the syntax <TransitiveModule/.......h>
:
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
FOUNDATION_EXPORT const unsigned char TransitiveModuleVersionString[];
// Header files.
#import <TransitiveModule/xxxxxxx.h>
What am I missing? Is this a solvable issue, or do I have to contribute to that external XCFramework to change the import style?
Thanks in advance,
Pedro
Reproducible project
You can use this project to reproduce the issue using this project. If you try to compile the target App
, you'll notice that it complains about missing module GoogleMobileAds