.swiftinterface 'No such module' in XCFramework

Viewed 67

I've been trying to build an XCFramework from my program that wraps C code into Swift and I need it to support both x86_64 and arm64 archs for MacOS. I have succeeded in creating a .framework that combines the two binaries from both architectures into a single universal fat file (as you can see below) using lipo -create -output and once I implement this .framework into any Xcode project, it works right out of the box and I'm able to import it and use it without major issue.

sebasmontero@Sebastians-MBP faspio % lipo -info _builds/apple-universal/FaspIO.framework/FaspIO
Architectures in the fat file: _builds/apple-universal/FaspIO.framework/FaspIO are: x86_64 arm64

The trouble begins when I try to generate an XCFramework using this exact same universal .framework. I'm running xcodebuild -create-xcframework -framework /myFramework.framework -output myXCFramework.xcframework as you do normally and the XCFramework is generated successfully, but. when I try including it in an Xcode Project, I get a 'No such module' on the .swiftinterface file, specifically in the imported module that wraps my C code and maps it into Swift.

.../FaspIO.framework/Modules/FaspIO.swiftmodule/arm64-apple-macos.swiftinterface:4:8: No such module 'CFaspIO'

I appreciate any help or pointers!

0 Answers
Related