Post

Replies

Boosts

Views

Activity

Reply to How to package a static library and headers into an XCFramework?
Thanks for getting back to me Ed! @DTS Engineer I actually ended up figuring it out. Building the C++ project with cmake dirName \ -G "Unix Makefiles" \ -B buildDir \ -DCMAKE_INSTALL_PREFIX=installDir \ -DCMAKE_SYSTEM_NAME=iOS \ -DCMAKE_SYSTEM_PROCESSOR=aarch64 \ # Changed -DCMAKE_OSX_ARCHITECTURES=arm64 \ -DCMAKE_OSX_SYSROOT=iphonesimulator \ # Changed -DCMAKE_OSX_DEPLOYMENT_TARGET=15.0 ... Allowed me to create the XCFramework with the resulting lib and headers. The change is for the -DCMAKE_SYSTEM_PROCESSOR=aarch64 argument, changed from arm64, and the -DCMAKE_OSX_SYSROOT=iphonesimulator argument, changed from $(xcrun --sdk iphonesimulator --show-sdk-path). I'm not sure if both or only one of the arguments solved the issue, but this allowed me to create an XCFramework that worked with an iOS simulators. Slightly unrelated: lipo-ing the x86_64 version of the simulator lib into the arm64 lib in the XCFramework also allows it to run on x86_64 simulators, as trying to -create-xcframework with the x86_64 and arm64 simulator libs produces an error, but hacking it this way makes things work.
1w
Reply to Static libraries into XCFramework
The problem I'm having is I don't have an Xcode project. I have the static libraries and all the headers I need and I just need to create an XCFramework of them. I don't have an Xcode project. Why is it not possible/recommended to do this outside of Xcode? I'm trying to wrap a C++ library in a Swift package, which itself doesn't have project files anyways. Is it not a feasibly use case that one would have access to the static libraries and headers via some external build system and just want an XCFramework of them?
2w