faithfracture / Apple-Boost-BuildScript

Script for building Boost for Apple platforms (iOS, iOS Simulator, tvOS, tvOS Simulator, OS X)
279 stars 111 forks source link

Generate xcframework instead of 'old-style' frameworks #52

Closed guillaumealgis closed 4 years ago

guillaumealgis commented 4 years ago

So... that was quicker than expected. My fork hadn't diverged too much from upstream so that was relatively easy to port. Anyway.

This replaces the buildFramework function with buildXCFramework. The resulting xcframework looks like this :

Screenshot of the xcframework directory in Finder

❯ lipo -info dist/boost.xcframework/*/libboost.a
Non-fat file: dist/boost.xcframework/ios-arm64/libboost.a is architecture: arm64
Non-fat file: dist/boost.xcframework/ios-x86_64-simulator/libboost.a is architecture: x86_64
Non-fat file: dist/boost.xcframework/macos-x86_64/libboost.a is architecture: x86_64
Non-fat file: dist/boost.xcframework/tvos-arm64/libboost.a is architecture: arm64
Non-fat file: dist/boost.xcframework/tvos-x86_64-simulator/libboost.a is architecture: x86_64

I didn't see any reason to keep the "old-style" frameworks building function around, but maybe we should? Idk if it's possible to use xcframeworks on older version of Xcode.

Having not yet played with Catalyst I'm not 100% sure of the remaining steps to support it (regarding https://github.com/faithfracture/Apple-Boost-BuildScript/issues/49), but it should be a matter of adding a new "target" to the script with the correct platform / arch I guess?