krzyzanowskim / OpenSSL

OpenSSL package for SwiftPM, CocoaPod, and Carthage, multiplatform
https://swift.best
Other
907 stars 334 forks source link

Add support for static frameworks / XCFramework in create-frameworks.sh #134

Closed johnhammerlund closed 2 years ago

johnhammerlund commented 2 years ago

The problem: create-frameworks.sh is limited to producing dynamic libraries. In use cases that make sense, static linking can lead to better optimization.

This adds a simple flag to create-frameworks.sh, -s, which overrides the mach-o format to instead be a static library. The resulting output frameworks, along with the final XCFramework, are produced as static libraries instead of dynamic libraries. Since the existing OpenSSL.framework is already just a simple repackaging of the libcrypto and libssl libraries, I don't believe that anything else needs to be touched.

Examples:

./scripts/create-frameworks.sh # Builds dynamic frameworks / dynamic XCFramework, as usual
./scripts/create-frameworks.sh -s # Builds static frameworks / static XCFramework

No worries if you'd prefer a different approach, or if this isn't in the scope of this project.

richardtop commented 2 years ago

Interested in having this feature!

krzyzanowskim commented 2 years ago

thank you!