iOS, FFmpeg: Add variable for controlling minimum iOS version

Currently this script relies on hard-coded values specify minimum
iOS version to link against.

This patch unifies the hard-coded values into a single variable.

No functional changes.

Pick-to: 6.9 6.8
Change-Id: I12bddeb53f0fe3388ea55c841a9864722a1d5f82
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
Nils Petter Skålerud
2025-03-25 13:06:37 +01:00
committed by Nils Petter Skålerud
parent 02efff7fa1
commit d39ac6a4ec

View File

@@ -5,6 +5,10 @@
# This script will build and install FFmpeg static libs
set -ex
# Must match or be lower than the minimum iOS version supported by the version of Qt that is
# is currently being built.
readonly MINIMUM_IOS_VERSION="16.0"
source "${BASH_SOURCE%/*}/../unix/ffmpeg-installation-utils.sh"
ffmpeg_source_dir=$(download_ffmpeg)
@@ -18,15 +22,15 @@ build_ffmpeg_ios() {
if [ "$target_platform" == "arm64-simulator" ]; then
target_sdk="iphonesimulator"
target_cpu_arch="arm64"
minos="-mios-simulator-version-min=16.0"
minos="-mios-simulator-version-min=$MINIMUM_IOS_VERSION"
elif [ "$target_platform" == "x86_64-simulator" ]; then
target_sdk="iphonesimulator"
target_cpu_arch="x86_64"
minos="-mios-simulator-version-min=16.0"
minos="-mios-simulator-version-min=$MINIMUM_IOS_VERSION"
elif [ "$target_platform" == "arm64-iphoneos" ]; then
target_sdk="iphoneos"
target_cpu_arch="arm64"
minos="-miphoneos-version-min=16.0"
minos="-miphoneos-version-min=$MINIMUM_IOS_VERSION"
else
echo "Error when building FFmpeg for iOS. Unknown parameter given for target_platform: '${target_platform}'"
exit 1
@@ -89,7 +93,6 @@ build_info_plist() {
local framework_id="$3"
local minimum_version_key="MinimumOSVersion"
local minimum_os_version="16.0"
local supported_platforms="iPhoneOS"
# TODO: This should be filled out with the actual version of FFmpeg that we are
@@ -117,7 +120,7 @@ build_info_plist() {
<key>CFBundleSignature</key>
<string>????</string>
<key>${minimum_version_key}</key>
<string>${minimum_os_version}</string>
<string>${MINIMUM_IOS_VERSION}</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>${supported_platforms}</string>