I know that the Xcode projects for iOS and MacOS have been merged in recent releases of SDL2, with them now being different targets rather than separate project files. But what’s the new syntax for building libSDL2.a for iOS at the command line?
Looks like you’re using -scheme rather than -target to isolate just the iOS build. Is there any advantage in doing that? As far as I can tell -target is doing what I want.
Schemes can have different actions and are associated with a target. Available actions:
build
archive
test
installsrc
install
clean
I didn’t notice at the time, but the scheme specified in your OP isn’t one of the schemes in the actual SDL Xcode project, which is why it wasn’t working. That’s why you also had to specify a target. Since each target is already associated with a scheme, you can just specify the scheme.
You can see which schemes are available in Xcode in the scheme navigator
It was working, in the sense that it was building for both MacOS and iOS. But the MacOS build fails which is why I’ve now specified an explicit target. My command line still includes that same scheme:
-target 'Static Library-iOS' -scheme='libSDL'
I’m happy with the results I am getting, but if I do encounter any problems from specifying a ‘non-existent’ scheme I can try the method you use.
I suspect the reason it worked is that the syntax is wrong: -scheme=. The equals sign is probably making it create an environment variable! That is what was in the original script I was given a long time ago - probably by you!
I’m now trying to do the same for SDL_ttf, but the SDL_ttf.xcodeproj file does not include a Static Library-iOS scheme, indeed it seems only to include targets for MacOS! What should I do to build a static SDL_ttf library for iOS?