Handling of multiple architecture in build script
Hi,
In order to finish and merge !32 for good, we need to decide how to build the multiple architecture at once.
Here is what I planned for now:
Options
There were -f
, -a
and -s
options but it was unclear what they were for in the previous iteration of the script.
There are two goals with these three options:
- choose whether to build for device or simulator (ie. which sdk to use)
- choose which architecture to build
However, in the current state, it's pretty incompatible:
- specifying an architecture will enable both device and simulator
- specifying an architecture, and then enabling device or simulator will not have the same effect as doing the same thing in opposite order
- specifying
-f
will build both for device and simulator so there is no way to build only for device, just like specifying-a
although it didn't even make sense to build both when selecting a device-only architecture (before mac arm probably)
In addition, specifying -a
will enforce BUILD_STATIC_FRAMEWORK=yes
although it could also be used as dynamic (and is in framework like libvlcsharp).
Instead, we could remove these and specify in the build scripts the architectures we want to build:
./compileAndBuildVLCKit.sh iphone # Will build all iphoneos/iphonesimulator architecture
./compileAndBuildVLCKit.sh iphoneos # Will build all iphoneos architecture
./compileAndBuildVLCKit.sh iphoneos-arm64 iphonesimulator-x86_64 # Will build the two architecture with the different SDK
./compileAndBuildVLCKit.sh iphone appletv # Will build all architecture with all SDK (os, simulator) for iphone and appletv
./compileAndBuildVLCKit.sh all # Will build everything
It's also quite compatible with the idea of building an XCFramework, combining sdk+arch instead of just arch like a fat framework. If not building an XCFramework but only multiple fat framework, it also helps making a framework with only the selected architecture instead of all availables.
Then, we would also add:
-
-m static
and-m shared
to specify whether we want to build a static or shared framework
I already did work to introduce this, and it's providing huge simplifications to the script, but there are still some points unsolved. In particular, the question of which SDK should be used and which version/min-version is used is completely unhandled in this design.
I'm looking forward some feedback on this design.