Skip to content
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

Support for xcframework (macos, ios, tvos, catalyst) #21

Closed
paulocoutinhox opened this issue Dec 1, 2023 · 1 comment · Fixed by #23
Closed

Support for xcframework (macos, ios, tvos, catalyst) #21

paulocoutinhox opened this issue Dec 1, 2023 · 1 comment · Fixed by #23
Labels
help wanted Extra attention is needed

Comments

@paulocoutinhox
Copy link
Contributor

Hi,

We need the xcframework for plataforms (macos x64, macos arm64, ios arm64, ios simulator x64 and arm64, tvos simulator and device x64 and arm64, catalyst x64 and arm64)

  1. Create a library for each platform and use cmake platform selector to specify the correct library for each:
    https://github.com/leetal/ios-cmake/blob/master/ios.toolchain.cmake#L353-L374

  2. Create an IF that check effective platform, example:
    https://github.com/tdlib/td/blob/master/CMake/iOS.cmake#L66-L119

  3. Create a xcframework that is a simple command that unify all .a or .so or .dylib files after you use lipo:
    Do a lipo to join all simulators x64 and arm64 into one lib and after, create the xcframework:

xcodebuild -create-xcframework \
  -library ./libxyz_macos.a \
  -headers ./include/ \
  -library ./libxyz_iossimulator.a \
  -headers ./include/ \
  -library ./libxyz_maccatalyst.a \
  -headers ./include/ \
  -library ./libxyz_tvos.a \
  -headers ./include/ \
  -library ./libxyz_ios.a \
  -headers ./include/ \
  -output XYZ.xcframework

Thanks.

@halx99 halx99 added the help wanted Extra attention is needed label Jan 19, 2024
halx99 added a commit that referenced this issue Apr 1, 2024
halx99 added a commit that referenced this issue Apr 1, 2024
@halx99 halx99 linked a pull request Apr 2, 2024 that will close this issue
@halx99 halx99 closed this as completed in #23 Apr 2, 2024
@paulocoutinhox
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants