implement a build flag to disable an external library

This commit is contained in:
Taner Sener 2021-12-28 00:33:12 +00:00
parent ae708befea
commit 3ed992a822
6 changed files with 57 additions and 1 deletions

View File

@ -15,6 +15,7 @@ export BASEDIR="$(pwd)"
export FFMPEG_KIT_BUILD_TYPE="android"
source "${BASEDIR}"/scripts/variable.sh
source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh
disabled_libraries=()
# SET DEFAULTS SETTINGS
enable_default_android_architectures
@ -111,6 +112,11 @@ while [ ! $# -eq 0 ]; do
enable_library "${ENABLED_LIBRARY}"
;;
--disable-lib-*)
DISABLED_LIB=$(echo $1 | sed -e 's/^--[A-Za-z]*-[A-Za-z]*-//g')
disabled_libraries+=("${DISABLED_LIB}")
;;
--disable-*)
DISABLED_ARCH=$(echo $1 | sed -e 's/^--[A-Za-z]*-//g')
@ -149,6 +155,11 @@ if [[ -n ${BUILD_FULL} ]]; then
done
fi
# DISABLE SPECIFIED LIBRARIES
for disabled_library in ${disabled_libraries[@]}; do
set_library "${disabled_library}" 0
done
# IF HELP DISPLAYED EXIT
if [[ -n ${DISPLAY_HELP} ]]; then
display_help

View File

@ -170,6 +170,7 @@ export BASEDIR="$(pwd)"
source "${BASEDIR}"/scripts/variable.sh
export FFMPEG_KIT_BUILD_TYPE="apple"
source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh
disabled_libraries=()
# SET DEFAULTS SETTINGS
enable_default_architecture_variants
@ -233,6 +234,11 @@ while [ ! $# -eq 0 ]; do
enable_library "${ENABLED_LIBRARY}"
;;
--disable-lib-*)
DISABLED_LIB=$(echo $1 | sed -e 's/^--[A-Za-z]*-[A-Za-z]*-//g')
disabled_libraries+=("${DISABLED_LIB}")
;;
--disable-*)
DISABLED_ARCH_VARIANT=$(echo $1 | sed -e 's/^--[A-Za-z]*-//g')
@ -258,6 +264,11 @@ if [[ -n ${BUILD_FULL} ]]; then
done
fi
# DISABLE SPECIFIED LIBRARIES
for disabled_library in ${disabled_libraries[@]}; do
set_library "${disabled_library}" 0
done
# IF HELP DISPLAYED EXIT
if [[ -n ${DISPLAY_HELP} ]]; then
display_help

11
ios.sh
View File

@ -16,6 +16,7 @@ export BASEDIR="$(pwd)"
export FFMPEG_KIT_BUILD_TYPE="ios"
source "${BASEDIR}"/scripts/variable.sh
source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh
disabled_libraries=()
# SET DEFAULTS SETTINGS
enable_default_ios_architectures
@ -120,6 +121,11 @@ while [ ! $# -eq 0 ]; do
enable_library "${ENABLED_LIBRARY}"
;;
--disable-lib-*)
DISABLED_LIB=$(echo $1 | sed -e 's/^--[A-Za-z]*-[A-Za-z]*-//g')
disabled_libraries+=("${DISABLED_LIB}")
;;
--disable-*)
DISABLED_ARCH=$(echo $1 | sed -e 's/^--[A-Za-z]*-//g')
@ -155,6 +161,11 @@ if [[ -n ${BUILD_FULL} ]]; then
done
fi
# DISABLE SPECIFIED LIBRARIES
for disabled_library in ${disabled_libraries[@]}; do
set_library "${disabled_library}" 0
done
# IF HELP DISPLAYED EXIT
if [[ -n ${DISPLAY_HELP} ]]; then
display_help

View File

@ -16,6 +16,7 @@ export BASEDIR="$(pwd)"
export FFMPEG_KIT_BUILD_TYPE="macos"
source "${BASEDIR}"/scripts/variable.sh
source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh
disabled_libraries=()
# SET DEFAULTS SETTINGS
enable_default_macos_architectures
@ -120,6 +121,11 @@ while [ ! $# -eq 0 ]; do
enable_library "${ENABLED_LIBRARY}"
;;
--disable-lib-*)
DISABLED_LIB=$(echo $1 | sed -e 's/^--[A-Za-z]*-[A-Za-z]*-//g')
disabled_libraries+=("${DISABLED_LIB}")
;;
--disable-*)
DISABLED_ARCH=$(echo $1 | sed -e 's/^--[A-Za-z]*-//g')
@ -150,6 +156,11 @@ if [[ -n ${BUILD_FULL} ]]; then
done
fi
# DISABLE SPECIFIED LIBRARIES
for disabled_library in ${disabled_libraries[@]}; do
set_library "${disabled_library}" 0
done
# IF HELP DISPLAYED EXIT
if [[ -n ${DISPLAY_HELP} ]]; then
display_help

View File

@ -1467,7 +1467,8 @@ print_redownload_requested_libraries() {
# 1 - library index
get_external_library_license_path() {
case $1 in
1 | 35) echo "${BASEDIR}/src/$(get_library_name "$1")/LICENSE.TXT" ;;
1) echo "${BASEDIR}/src/$(get_library_name "$1")/LICENSE.TXT" ;;
35) echo "${BASEDIR}/src/$(get_library_name "$1")/LICENSE.txt" ;;
3 | 39) echo "${BASEDIR}/src/$(get_library_name "$1")/COPYING.LESSERv3" ;;
5 | 41) echo "${BASEDIR}/src/$(get_library_name "$1")/$(get_library_name "$1")/COPYING" ;;
19) echo "${BASEDIR}/src/$(get_library_name "$1")/$(get_library_name "$1")/LICENSE" ;;

11
tvos.sh
View File

@ -16,6 +16,7 @@ export BASEDIR="$(pwd)"
export FFMPEG_KIT_BUILD_TYPE="tvos"
source "${BASEDIR}"/scripts/variable.sh
source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh
disabled_libraries=()
# SET DEFAULTS SETTINGS
enable_default_tvos_architectures
@ -120,6 +121,11 @@ while [ ! $# -eq 0 ]; do
enable_library "${ENABLED_LIBRARY}"
;;
--disable-lib-*)
DISABLED_LIB=$(echo $1 | sed -e 's/^--[A-Za-z]*-[A-Za-z]*-//g')
disabled_libraries+=("${DISABLED_LIB}")
;;
--disable-*)
DISABLED_ARCH=$(echo $1 | sed -e 's/^--[A-Za-z]*-//g')
@ -150,6 +156,11 @@ if [[ -n ${BUILD_FULL} ]]; then
done
fi
# DISABLE SPECIFIED LIBRARIES
for disabled_library in ${disabled_libraries[@]}; do
set_library "${disabled_library}" 0
done
# IF HELP DISPLAYED EXIT
if [[ -n ${DISPLAY_HELP} ]]; then
display_help