I’m trying to build SDL3_ttf.xcframework target on Mac (Sonoma 14.6.1, XCode 16.1) but it fails with:
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ generic:1, platform:tvOS Simulator }
I don’t have tvOS sim installed, I do not want to install it or build an app for it. The SDL_ttf main project is set to Supported platforms: macOS, iOS and I have removed every project reference to tvOS (and watchOS+visionOS) that I could find. The SDL3_ttf framework target builds without errors for my desired destinations.
My question is, how do I exclude unwanted platforms when building SDL3_ttf xcframework?
Note: I have the exact same problem with SDL3, luckily there is a pre-built xcframework distributed with each release. Wishlist: Would be truly awesome if all SDL satellite libraries would include pre-built fat binaries for Mac, to allow focusing on app development instead of building SDL from source.
Continuation/workaround: Because the xcode build process does create xcarchives for the installed platforms before it errors out, it is possible to roll your own SDL3_ttf.xcframework by using the following method.
After build fails, check if any xcarchives have been created (XCode Product menu->Reveal build folder in Finder). Copy the entire folder containing *.xcarchives to a suitable location, or copy the build path (Product menu->Copy build folder path).
Edit attached script and set XCARC_PATH variable to point to the folder path where xcarchives are located. Add/remove platform frameworks in the script as required.
Run script. Copy the created .xcframework to /Library/Frameworks, then add to your own project.
Although I haven’t tried it yet, in theory this method should work with any SDL satellite library (ttf, mixer, image) if the SDL_Lib variable is updated accordingly. Script:
#!/bin/sh
# Path to directory where XCode built xcarchives are located
XCARC_PATH=./xcarchives
#Name of SDL library to create xcframework for
SDL_Lib=SDL3_ttf
#Add/remove -archive options as needed
xcodebuild -create-xcframework \
-archive $XCARC_PATH/$SDL_Lib-iphonesimulator.xcarchive -framework $SDL_Lib.framework \
-archive $XCARC_PATH/$SDL_Lib-iphoneos.xcarchive -framework $SDL_Lib.framework \
-archive $XCARC_PATH/$SDL_Lib-macosx.xcarchive -framework $SDL_Lib.framework \
-output xcframeworks/$SDL_Lib.xcframework