Closed Schlaubischlump closed 4 years ago
For anyone else wondering. This seems to work:
MIN_OSX_VERSION="11.0"
MIN_IOS_VERSION="14.0"
build()
{
make clean
ARCH=$1
TARGET=$2
HOST=$3
SDK=$4
SDK_PATH=`xcrun -sdk ${SDK} --show-sdk-path`
export PREFIX=$(pwd)/build/${ARCH}
export CFLAGS="-arch ${ARCH} -target ${TARGET} -isysroot ${SDK_PATH} -mmacosx-version-min=${MIN_OSX_VERSION} -Wno-overriding-t-option -fembed-bitcode"
export CXXFLAGS=${CFLAGS}
export LDFLAGS=${CFLAGS}
export CC="$(xcrun --sdk ${SDK} -f clang) ${CFLAGS}"
export CXX="$(xcrun --sdk ${SDK} -f clang++) ${CFLAGS}"
export CCLD=$CC
export CXXLD=$CXX
echo $CC
./autogen.sh --disable-dependency-tracking --without-cython --host=${HOST} --prefix=${PREFIX}
make -j 8
#make install
}
# Catalyst
build "x86_64" "x86_64-apple-ios${MIN_IOS_VERSION}-macabi" "x86_64-apple-darwin" "macosx"
As you can see, the c++ part and the minimum macOS version was missing. It now compiles, I still need to test if it works. Some of these flags might not be required. If it does indeed work, I will close the issue.
@Schlaubischlump Do you know how to build all of the libimobiledevice dynamic libraries for MacCatalyst? I am a c# developer and this seems to be a big learning curve.
Are static libraries okay as well ?
I have a (buggy) script (Repo: build-libimobiledevice) on my github profile that builds libimobiledevice for iOS (although it won't work on iOS, since usbmuxd does not exist). You should be able to adapt the script for MacCatalyst easily. Changing the platform or architecture or something like this should be enough. The script will output static libraries (.a files). You can then create XCFrameworks from the static libraries. You can find an example and a script on how to do this on my github as well (Repo: XCF).
This is most likely not a bug, but rather a help request for compiling libplist for macOS Catalyst. The source code should be compatible, because there is already an iOS port of libplist. I'm trying to compile it on macOS Big Sur with the following command:
Which yields the error:
Does anybody know which flag I'm missing ?