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

Universal Binary Possible? #12

Closed creativexp closed 7 years ago

creativexp commented 7 years ago

Hi,

Great script!

I am trying to build a universal fat library for ios that includes arm64, armv7 and armv7s. Thats all those architectures in one file for each boost lib.

How would i do this with your script?

faithfracture commented 7 years ago

Right now the script does build a universal binary for arm64 and armv7 only. Is there a particular reason you need armv7s? I omitted it from the script on purpose because Apple dropped it as a default arch starting in Xcode 6, it was only supported on the iPhone 5 and iPad 4, and it's not needed for applications that you want to run on these devices - they run apps built for armv7 anyways.

If you really want to add it, you would need to add the armv7s architecture to the section of updateBoost() that configures the user-config.jam file for iOS, and add the armv7s directory to all of the places in scrunchAllLibsTogetherInOnLibPerPlatform() that grab files out of the specific architecture directories.

creativexp commented 7 years ago

Thanks for the help, i will make those changes.

I think armv7s is needed if you are developing on a device through Xcode. I am using ipad mini and i get a error saying that armv7s is missing.

"file is universal (3 slices) but does not contain a(n) armv7s slice: /file/location for architecture armv7s clang: error: linker command failed with exit code 1 (use -v to see invocation)"

I could drop armv7s from the valid architectures in xcode but this is a workaround, there are devices out there still using armv7s especially in developing nations.

At the moment the script outputs separate folders for armv7 and arm64 with a library in each. I am looking to create one library that contains both armv7 and arm64(and armv7s once i set that up).

What parameters would i pass to the script to get this result for say the filesystem boost library?

faithfracture commented 7 years ago

That's weird. I've run from Xcode on armv7s devices without trouble before. There must be something else going on.

The script already outputs a fat library with both armv7 and arm64 libraries in it. It is in the build/boost/{BOOST_VERSION}/ios/prefix/lib directory.

If you want to build just the filesystem library for iOS only, you would run ./boost.sh -ios --boost-libs filesystem. The resulting universal binary will be located at build/boost/{BOOST_VERSION}/ios/prefix/lib. You'll need both the lib and includes directory, or you can just use boost.framework, located in the framework directory next to the prefix directory.

creativexp commented 7 years ago

Sorry for delay in getting back. I found the fat library. I think this is to do with my device not being able to run opengl es 3. Not related to boost.

faithfracture commented 7 years ago

Ok, thanks for the update.