I'm working getting a large app to Universal Binary, which uses a number of libraries and frameworks with third-party dependencies, a few of which are not yet available as arm64.
If a framework is marked as Optional in the app's build settings, the app will still link when it is absent.
I expected that if the framework only had one architecture needed for UB (e.g. just x86_64), we should be able to optionally link it successfully, and it would not matter if one architecture was missing.
However this isn't how Xcode handles it, we get a linker error for the missing architecture even if the framework is optional.
Is there a way to do what I'm expecting? Include an optional framework with only one architecture in a UB app, with the app taking responsibility for correct handling of the framework at runtime (just as it would for a missing optional framework in a single-architecture app)?
You can change the value of the VALIDATE_WORKSPACE
build setting to No on the app target. The client code that calls into the framework needs to be appropriately guarded with macros so that there are no symbols to link for Apple silicon pointing at the framework that's not yet available as a Universal Binary.