I had some trouble attempting to build an XCFramework of OpenCV, but I finally got a successful build with the following steps:
- Clone the OpenCV repo:
git clone git@github.com:opencv/opencv.git cd opencv
- Disable building with
libjpeg-turbo
[^1] by applying a patch:git apply path/to/opencv-5-28-50.patch