Post not yet marked as solved
Post marked as unsolved with 0 replies, 719 views
What I am trying to do is build an XCFramework which I would like to be available for iOS and iOS Simulator. As soon as I turn on `Defines Module` and `Build Libraries for Distribution` the swiftinterface files are no longer generated. It archives and I can create a the XCFramework just fine. If I don't define a module then the files are generated. However when I go to import the sub framework that defines a module, it can not import the file it produces an error when the Framework that defines a module can’t be found in the main Framework’s swiftinterface file. For a simple example of the issue I created a GitHub project. https://github.com/possen/HostAppIf it Is not allowed it would be good to have an error or warning, but really kind of need this capability. Most third party libraries define a module, and I want to enable be able to use an XCFramework.Open the project from GitHub and build, there are 4 targets, of those there are two frameworks, the main difference between the BarKit and FooKit frameworks is that BarKit has the “Defines Module” flag set to true. First build the HostApp target, this will generate FooKit.framework and Bar.framework. Next, run the ./create_xcframework script included in the root of the project. Look at the generated XCFramework. Foo.framework does not define a module and therefore generates swiftinterface files, BarKit.framework does defines a module, it does not generate swiftinterface files. Now, build the HostAppXC target, it will fail to build because the BarKit.framework has no swiftinterface files. If you turn off “Defines Module” for BarKit.framework, rerun ./create_xcframework, then it compiles and runs.