xcframeworkbuild.sh: add arm64 simulator target

this fixes simulator builds on an M1

Bug: webp:510
Change-Id: Ia2c81d33d9a85b432b17f22305b110ccc337b809
This commit is contained in:
James Zern 2021-03-13 17:42:11 -08:00
parent 5d4ee4c3c0
commit 25ae67b3de

View File

@ -48,6 +48,7 @@ PLATFORMS[$MACOS_CATALYST]="MacOSX-Catalyst-x86_64"
if [[ "${XCODE%%.*}" -ge 12 ]]; then if [[ "${XCODE%%.*}" -ge 12 ]]; then
PLATFORMS[$MACOS]+=" MacOSX-arm64" PLATFORMS[$MACOS]+=" MacOSX-arm64"
PLATFORMS[$MACOS_CATALYST]+=" MacOSX-Catalyst-arm64" PLATFORMS[$MACOS_CATALYST]+=" MacOSX-Catalyst-arm64"
PLATFORMS[$IOS_SIMULATOR]+=" iPhoneSimulator-arm64"
elif [[ "${XCODE%%.*}" -eq 11 ]]; then elif [[ "${XCODE%%.*}" -eq 11 ]]; then
cat << EOF cat << EOF
WARNING: Xcode 12.0 or higher is required to build targets for WARNING: Xcode 12.0 or higher is required to build targets for
@ -140,7 +141,9 @@ for (( i = 0; i < $NUM_PLATFORMS; ++i )); do
CFLAGS="-pipe -isysroot ${SDKROOT} -O3 -DNDEBUG" CFLAGS="-pipe -isysroot ${SDKROOT} -O3 -DNDEBUG"
case "${PLATFORM}" in case "${PLATFORM}" in
iPhone*) iPhone*)
CFLAGS+=" -miphoneos-version-min=${IOS_MIN_VERSION} -fembed-bitcode" CFLAGS+=" -fembed-bitcode"
CFLAGS+=" -target ${ARCH}-apple-ios${IOS_MIN_VERSION}"
[[ "${PLATFORM}" == *Simulator* ]] && CFLAGS+="-simulator"
;; ;;
MacOSX-Catalyst*) MacOSX-Catalyst*)
CFLAGS+=" -target" CFLAGS+=" -target"