IOS_INSTALL_COMBINED seems like the wrong approach?
If I use IOS_INSTALL_COMBINED when building a static library, several things can happen based on the values of ARCHS, ONLY_ACTIVE_ARCH, VALID_ARCHS, CMAKE_OSX_ARCHITECTURES etc., none of which seems entirely correct.
- It builds the library for iphoneos arm64, and at install time builds it for iphonesimulator x64, and combines them with lipo into a single .a file.
- It builds the library for iphoneos for both arm64 and x64, and at install time it prints that the simulator build was skipped.
In both cases the resulting library does not support an arm64 simulator and results in a build failure when trying to link into a simulator build on an ARM Mac.
Contrast this with (semi?)-official advice from Quinn, Apple Developer Support at https://developer.apple.com/forums/thread/673387
This is definitely not the right approach. A universal binary, by definition, can only contain architectures for the same platform. iOS and the iOS Simulator are different platforms and thus shouldn’t be mixed in a universal binary. ... You must use a combination of lipo and xcframework to achieve an ultimate "sumo" framework supporting multiple platforms and multiple architectures.
It seems to me that the above advice renders the entire concept of IOS_INSTALL_COMBINED misguided, or that it should be rewritten to create an XCFramework instead of a static library in this case. Am I correct or did I misinterpret something?