compiling boost for iOS simulator on apple silicon

I'm trying to get boost to compile for the iOS simulator on my M2 Mac.

I've got this script:

set -euxo pipefail

# See https://formulae.brew.sh/formula/boost
# See https://stackoverflow.com/questions/1577838/how-to-build-boost-libraries-for-iphone

wget https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.bz2
tar zxf boost_1_83_0.tar.bz2
mv boost_1_83_0 boost

root=`pwd`
cd boost

B2_ARGS="-a -j12 --with-iostreams --with-regex"

# Build for simulator
./bootstrap.sh --prefix=$root/install-ios-sim

IOSSIM_SDK_PATH=$(xcrun --sdk iphonesimulator --show-sdk-path)
cat << EOF >> project-config.jam
# IOS Arm Simulator
using clang : iphonesimulatorarm64
: xcrun clang++ -arch arm64 -stdlib=libc++ -std=c++20 -miphoneos-version-min=16.0 -fvisibility-inlines-hidden -target arm64-apple-ios16.0-simulator -isysroot $IOSSIM_SDK_PATH
;
EOF

./b2 $B2_ARGS --prefix=$root/install-ios-sim toolset=clang-iphonesimulatorarm64 link=static install

xcodebuild -create-xcframework thinks ./install-ios-sim/libboost_iostreams.a is not for the simulator.

Specifically, if you run the following after the build script, it will show the binary is ios-arm64.

xcodebuild -create-xcframework \
           -library install-ios-sim/lib/libboost_iostreams.a \
           -headers install-ios-sim/include \
           -output boost.xcframework

I know how to use lipo, etc to determine the architecture of a library, but I don't know how create-xcframework differentiates a simulator binary from an iOS binary.

Note: I've also tried using the boost build script by Pete Goodliffe which generates an xcframework. However, I need a normal install of boost because I'm compiling other libraries against it. I couldn't get the script to do that. I also don't understand how the script successfully generates a simulator binary.

compiling boost for iOS simulator on apple silicon
 
 
Q