I am working on an iOS framework that requires OpenSSL for certain functionalities. To keep the framework’s size minimal, I included only the iphoneos version of OpenSSL by compiling it specifically for iOS devices and dragging it into my framework.
However, when I integrate this framework into a project and try to run it on the simulator, I get build errors because the simulator architecture (iphonesimulator) is missing.
My Questions:
- Is there a way to avoid these issues without including the iphonesimulator version of OpenSSL in my framework?
- If not, do I need to create a universal framework or xcframework that includes both iphoneos and iphonesimulator builds of OpenSSL?
- If I must create a universal framework or xcframework, what is the correct way to achieve this?
Additional Context:
- The primary goal is to keep the framework size as small as possible.
- The framework must work seamlessly on both physical devices and simulators during development.
- OpenSSL is used only within the framework and not exposed externally.
Any guidance on achieving this would be highly appreciated. If creating a universal framework or xcframework is the best solution, an example script or detailed steps would be extremely helpful.
Thank you!
-
Have you tried using CommonCrypto instead of OpenSSL? It's already built into iOS and Apple recommends to use it instead of OpenSSL.Cy-4AH– Cy-4AH2024年12月03日 14:41:33 +00:00Commented Dec 3, 2024 at 14:41
-
Actually, I am using a library with a significant dependency on OpenSSL. Refactoring it to use CommonCrypto would take a considerable amount of time right now. However, I will still consider this option.Hakan Or– Hakan Or2024年12月03日 18:44:56 +00:00Commented Dec 3, 2024 at 18:44
-
1If you want to focus on framework size only, try to integrate it as a static library first, then only the required symbols will be copied into your main executable file, the full version of framework is unnecessary.Itachi– Itachi2024年12月04日 05:08:21 +00:00Commented Dec 4, 2024 at 5:08