From 319f56f1a1614c3ec142263ee02ef00782b8d740 Mon Sep 17 00:00:00 2001 From: James Zern Date: Tue, 8 Dec 2020 18:30:54 -0800 Subject: [PATCH] iosbuild.sh: sync some aspects of xcframeworkbuild.sh Change-Id: Ie29f986767132fe980d71e43f6b8d367a9e2e6a9 --- iosbuild.sh | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/iosbuild.sh b/iosbuild.sh index e4031de0..044745f0 100755 --- a/iosbuild.sh +++ b/iosbuild.sh @@ -1,8 +1,9 @@ #!/bin/bash # -# This script generates 'WebP.framework' and 'WebPDecoder.framework'. An iOS -# app can decode WebP images by including 'WebPDecoder.framework' and both -# encode and decode WebP images by including 'WebP.framework'. +# This script generates 'WebP.framework' and 'WebPDecoder.framework', +# 'WebPDemux.framework' and 'WebPMux.framework'. +# An iOS app can decode WebP images by including 'WebPDecoder.framework' and +# both encode and decode WebP images by including 'WebP.framework'. # # Run ./iosbuild.sh to generate the frameworks under the current directory # (the previous build will be erased if it exists). @@ -50,13 +51,27 @@ if [[ -z "${SDK}" ]]; then exit 1 elif [[ ${SDK%%.*} -gt 8 ]]; then EXTRA_CFLAGS="-fembed-bitcode" -elif [[ ${SDK} < 6.0 ]]; then +elif [[ ${SDK%%.*} -le 6 ]]; then echo "You need iOS SDK version 6.0 or above" exit 1 -else - echo "iOS SDK Version ${SDK}" fi +echo "Xcode Version: ${XCODE}" +echo "iOS SDK Version: ${SDK}" + +if [[ -e "${BUILDDIR}" || -e "${TARGETDIR}" || -e "${DECTARGETDIR}" \ + || -e "${MUXTARGETDIR}" || -e "${DEMUXTARGETDIR}" ]]; then + cat << EOF +WARNING: The following directories will be deleted: +WARNING: ${BUILDDIR} +WARNING: ${TARGETDIR} +WARNING: ${DECTARGETDIR} +WARNING: ${MUXTARGETDIR} +WARNING: ${DEMUXTARGETDIR} +WARNING: The build will continue in 5 seconds... +EOF + sleep 5 +fi rm -rf ${BUILDDIR} ${TARGETDIR} ${DECTARGETDIR} \ ${MUXTARGETDIR} ${DEMUXTARGETDIR} mkdir -p ${BUILDDIR} ${TARGETDIR}/Headers/ ${DECTARGETDIR}/Headers/ \ @@ -64,12 +79,12 @@ mkdir -p ${BUILDDIR} ${TARGETDIR}/Headers/ ${DECTARGETDIR}/Headers/ \ if [[ ! -e ${SRCDIR}/configure ]]; then if ! (cd ${SRCDIR} && sh autogen.sh); then - cat <