-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
building an iOS XCFramework for oneTBB #1252
Comments
Unfortunately, I am not a XCode bundling savvy, but isn't it what you need to generate a framework bundle for Mac and iOS https://cmake.org/cmake/help/latest/prop_tgt/FRAMEWORK.html#prop_tgt:FRAMEWORK? I believe it can be controlled via |
Thanks @isaevil ! With
I suspect I need to update I'm not very good with CMake. |
You can try following: --- a/cmake/utils.cmake
+++ b/cmake/utils.cmake
@@ -35,8 +35,11 @@ macro(tbb_install_target target)
COMPONENT runtime
ARCHIVE
DESTINATION ${CMAKE_INSTALL_LIBDIR}
- COMPONENT devel)
-
+ COMPONENT devel
+ FRAMEWORK
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ COMPONENT runtime
+ OPTIONAL)
if (BUILD_SHARED_LIBS)
install(TARGETS ${target}
LIBRARY |
I'm running into similar issues, where we integrate oneTBB via Conan. |
I'm trying to build an xcframework (and Swift Package) for oneTBB. I'm aware that tbb shouldn't be built as a static library due to singletons. (this iOS port builds tbb as a static library)
I've got this script: https://github.com/audulus/tbb-spm/blob/main/xcframework.sh
The script generates an xcframework out of dylibs, but alas Apple says:
Avoid using dynamic library files (.dylib files) for dynamic linking. An XCFramework can include dynamic library files, but only macOS supports these libraries for dynamic linking. Dynamic linking on iOS, watchOS, and tvOS requires the XCFramework to contain .framework bundles.
So I need to create frameworks for both macOS and iOS (because I can't mix dylibs and frameworks in an XCFramework).
How should I approach that? When I generate Xcode projects with cmake, it requires code signing. Also seems like the target is still a dylib, not a framework.
So I suppose I simply have to assemble the frameworks according to apple's format with a bunch of shell commands (making the appropriate directories, copying in plists, setting up symlinks). I haven't found a tool that will assemble a framework from a dylib.
Thanks for any help!
The text was updated successfully, but these errors were encountered: