From b0119624dd2096d2736df910903546c58b248359 Mon Sep 17 00:00:00 2001 From: wang-bin Date: Thu, 24 Aug 2023 10:10:36 +0800 Subject: [PATCH] add ios simulator arm64 --- .github/workflows/build.yml | 2 +- avbuild.sh | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fdd607e..0002224 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,7 +50,7 @@ jobs: export FFSRC=$PWD/ffmpeg-${FF_VERSION} [ "${TARGET_OS}" = iOS ] && export USER_OPT="--enable-wolfssl" ./avbuild.sh ${TARGET_OS} - if [ "${TARGET_OS}" = iOS ]; then + if [[ "${TARGET_OS}" == "iOS"* ]]; then find sdk-* -name "*.dylib" -delete fi - name: Make SDK diff --git a/avbuild.sh b/avbuild.sh index e81e200..bf8a198 100755 --- a/avbuild.sh +++ b/avbuild.sh @@ -311,7 +311,7 @@ use_llvm_binutils() { local clang_dir=${USE_TOOLCHAIN%clang*} local clang_name=${USE_TOOLCHAIN##*/} local clang=$clang_dir${clang_name/-cl/} - local CLANG_FALLBACK=clang-${LLVM_VER:-16} + local CLANG_FALLBACK=clang-${LLVM_VER:-17} $IS_APPLE_CLANG && CLANG_FALLBACK=/usr/local/opt/llvm/bin/clang echo "clang: `$clang --version`" # -print-prog-name= prints native dir format(on windows) and `which` fails @@ -1043,6 +1043,7 @@ setup_ios_env() { # clang -arch i386 -arch x86_64 ## cc="xcrun -sdk iphoneos clang" or cc=`xcrun -sdk iphoneos --find clang` local IOS_ARCH=$1 + local OS=$2 local cc_has_bitcode=false # bitcode since xcode 7. deprecated in xcode14 clang -fembed-bitcode -E - /dev/null && cc_has_bitcode=true : ${BITCODE:=false} @@ -1060,7 +1061,7 @@ setup_ios_env() { local VER_OS=iphoneos local BITCODE_FLAGS= local ios5_lib_dir= - if [ "${IOS_ARCH:0:3}" == "arm" ]; then + if [[ "$IOS_ARCH" == "arm"* && "$OS" != *"simulator"* ]]; then $enable_bitcode && BITCODE_FLAGS="-fembed-bitcode" # also works for new sdks BITCODE_LFLAGS=$BITCODE_FLAGS if [ "${IOS_ARCH:3:2}" == "64" ]; then @@ -1084,6 +1085,8 @@ setup_ios_env() { ios_min=7.0 elif [ "${IOS_ARCH}" == "x86" ]; then IOS_ARCH=i386 + else + ios_min=8.0 fi # TOOLCHAIN_OPT+=" --disable-asm" # if bitcode fi @@ -1642,14 +1645,14 @@ build_all(){ [ -z "$archs" ] && { echo ">>>>>no arch is set. setting default archs..." [ "${os:0:3}" == "ios" ] && { - echo $os | grep simulator >/dev/null && archs=(x86 x86_64) || archs=(armv7 arm64) + echo $os | grep simulator >/dev/null && archs=(arm64 x86_64) || archs=(arm64) } [ "${os:0:7}" == "android" ] && archs=(armv7 arm64 x86 x86_64) [ "${os:0:3}" == "rpi" -o "${os:0:9}" == "raspberry" ] && archs=(armv6zk armv7-a) [[ "$os" == "sunxi" ]] && archs=(armv7) [ "${os:0:5}" == "mingw" ] && archs=(x86 x86_64) [ "${os:0:2}" == "vc" -o "${os:0:3}" == "win" ] && { - archs=(x86 x64 arm arm64) + archs=(x86 x64 arm64) [ -d "$VC_LTL_DIR" ] && archs=(x86 x64) } [[ "${os:0:5}" == "winrt" || "${os:0:3}" == "uwp" || "$os" == win*store* || "$os" == win*phone* ]] && archs=(x86 x64 arm arm64)