Since some people asked for exact steps on how to create the fat framework with lipo, here is how I did it:
# Create a template framework starting from the arm64 ios simulator one
mkdir -p build-iossim
cp -r build-iossim-arm64-release/target/MyFramework.framework build-iossim
# Merge the arm64 and x86_64 binaries with lipo
xcrun lipo -create -output build-iossim/MyFramework.framework/MyFramework build-iossim-x86_64-release/target/MyFramework.framework/MyFramework build-iossim-arm64-release/target/MyFramework.framework/MyFramework
# Codesign the fat binary
xcrun codesign --sign - build-iossim/MyFramework.framework/MyFramework
# Create the xcframework merging the ios_arm64 framework and the fat simulator framework
mkdir -p build-xcframework
xcodebuild -create-xcframework \
-framework build-ios-arm64-release/target/MyFramework.framework \
-framework build-iossim/MyFramework.framework \
-output "build-xcframework/MyFramework.xcframework"
Post
Replies
Boosts
Views
Activity
I experienced the same. The check in this case is too strict since optional is an header only library so it should be available indenpendently of the avaiable runtime, and compilation would fail anyway. Just looking at where the macro is defined[1] I discovered you can just define:_LIBCPP_DISABLE_AVAILABILITYto disable the availability mechanism as a whole, effectively working around the problem.By the way, I recommend you to post your development questions also to StackOverflow to have more chances to find answers quickly. It's so unconfortable to find posts on forum with exactly the same problem and zero answers.[1] https://github.com/llvm-mirror/libcxx/blob/master/include/__config