Skip to content

Commit

Permalink
allow extra cflags, cxxflags, ldflags
Browse files Browse the repository at this point in the history
  • Loading branch information
tanersener committed May 5, 2024
1 parent 17cfcbb commit 8d2c693
Show file tree
Hide file tree
Showing 10 changed files with 116 additions and 56 deletions.
14 changes: 13 additions & 1 deletion android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,21 @@ while [ ! $# -eq 0 ]; do
export NO_FFMPEG_KIT_PROTOCOLS="1"
;;
--toolchain=*)
ANDROID_TOOLCHAIN=$(echo $1 | sed -e 's/^--[a-z]*=//g')
ANDROID_TOOLCHAIN=$(echo $1 | sed -e 's/^--toolchain=//g')
export ANDROID_TOOLCHAIN="${ANDROID_TOOLCHAIN}"
;;
--extra-cflags=*)
EXTRA_CFLAGS=$(echo $1 | sed -e 's/^--extra-cflags=//g')
export EXTRA_CFLAGS="${EXTRA_CFLAGS}"
;;
--extra-cxxflags=*)
EXTRA_CXXFLAGS=$(echo $1 | sed -e 's/^--extra-cxxflags=//g')
export EXTRA_CXXFLAGS="${EXTRA_CXXFLAGS}"
;;
--extra-ldflags=*)
EXTRA_LDFLAGS=$(echo $1 | sed -e 's/^--extra-ldflags=//g')
export EXTRA_LDFLAGS="${EXTRA_LDFLAGS}"
;;
*)
print_unknown_option "$1"
;;
Expand Down
12 changes: 12 additions & 0 deletions ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,18 @@ while [ ! $# -eq 0 ]; do

export MAC_CATALYST_MIN_VERSION=${TARGET}
;;
--extra-cflags=*)
EXTRA_CFLAGS=$(echo $1 | sed -e 's/^--extra-cflags=//g')
export EXTRA_CFLAGS="${EXTRA_CFLAGS}"
;;
--extra-cxxflags=*)
EXTRA_CXXFLAGS=$(echo $1 | sed -e 's/^--extra-cxxflags=//g')
export EXTRA_CXXFLAGS="${EXTRA_CXXFLAGS}"
;;
--extra-ldflags=*)
EXTRA_LDFLAGS=$(echo $1 | sed -e 's/^--extra-ldflags=//g')
export EXTRA_LDFLAGS="${EXTRA_LDFLAGS}"
;;
*)
print_unknown_option "$1"
;;
Expand Down
12 changes: 12 additions & 0 deletions linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,18 @@ while [ ! $# -eq 0 ]; do

export API=${API_LEVEL}
;;
--extra-cflags=*)
EXTRA_CFLAGS=$(echo $1 | sed -e 's/^--extra-cflags=//g')
export EXTRA_CFLAGS="${EXTRA_CFLAGS}"
;;
--extra-cxxflags=*)
EXTRA_CXXFLAGS=$(echo $1 | sed -e 's/^--extra-cxxflags=//g')
export EXTRA_CXXFLAGS="${EXTRA_CXXFLAGS}"
;;
--extra-ldflags=*)
EXTRA_LDFLAGS=$(echo $1 | sed -e 's/^--extra-ldflags=//g')
export EXTRA_LDFLAGS="${EXTRA_LDFLAGS}"
;;
*)
print_unknown_option "$1"
;;
Expand Down
12 changes: 12 additions & 0 deletions macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,18 @@ while [ ! $# -eq 0 ]; do

export MACOS_MIN_VERSION=${TARGET}
;;
--extra-cflags=*)
EXTRA_CFLAGS=$(echo $1 | sed -e 's/^--extra-cflags=//g')
export EXTRA_CFLAGS="${EXTRA_CFLAGS}"
;;
--extra-cxxflags=*)
EXTRA_CXXFLAGS=$(echo $1 | sed -e 's/^--extra-cxxflags=//g')
export EXTRA_CXXFLAGS="${EXTRA_CXXFLAGS}"
;;
--extra-ldflags=*)
EXTRA_LDFLAGS=$(echo $1 | sed -e 's/^--extra-ldflags=//g')
export EXTRA_LDFLAGS="${EXTRA_LDFLAGS}"
;;
*)
print_unknown_option "$1"
;;
Expand Down
18 changes: 9 additions & 9 deletions scripts/function-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ get_cflags() {

local COMMON_INCLUDES=$(get_common_includes)

echo "${ARCH_FLAGS} ${APP_FLAGS} ${COMMON_FLAGS} ${OPTIMIZATION_FLAGS} ${COMMON_INCLUDES}"
echo "${ARCH_FLAGS} ${APP_FLAGS} ${COMMON_FLAGS} ${EXTRA_CFLAGS} ${OPTIMIZATION_FLAGS} ${COMMON_INCLUDES}"
}

get_cxxflags() {
Expand All @@ -387,26 +387,26 @@ get_cxxflags() {

case $1 in
gnutls)
echo "-std=c++11 -fno-rtti ${OPTIMIZATION_FLAGS}"
echo "-std=c++11 -fno-rtti ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
ffmpeg)
if [[ -z ${FFMPEG_KIT_DEBUG} ]]; then
echo "-std=c++11 -fno-exceptions -fno-rtti ${LINK_TIME_OPTIMIZATION_FLAGS} -O2 -ffunction-sections -fdata-sections"
echo "-std=c++11 -fno-exceptions -fno-rtti ${LINK_TIME_OPTIMIZATION_FLAGS} -O2 -ffunction-sections -fdata-sections ${EXTRA_CXXFLAGS}"
else
echo "-std=c++11 -fno-exceptions -fno-rtti ${FFMPEG_KIT_DEBUG}"
echo "-std=c++11 -fno-exceptions -fno-rtti ${FFMPEG_KIT_DEBUG} ${EXTRA_CXXFLAGS}"
fi
;;
opencore-amr)
echo "${OPTIMIZATION_FLAGS}"
echo "${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
x265)
echo "-std=c++11 -fno-exceptions ${OPTIMIZATION_FLAGS}"
echo "-std=c++11 -fno-exceptions ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
rubberband | srt | tesseract | zimg)
echo "-std=c++11 ${OPTIMIZATION_FLAGS}"
echo "-std=c++11 ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
*)
echo "-std=c++11 -fno-exceptions -fno-rtti ${OPTIMIZATION_FLAGS}"
echo "-std=c++11 -fno-exceptions -fno-rtti ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
esac
}
Expand Down Expand Up @@ -501,7 +501,7 @@ get_ldflags() {
fi
local COMMON_LINKED_LIBS=$(get_common_linked_libraries "$1")

echo "${ARCH_FLAGS} ${OPTIMIZATION_FLAGS} ${COMMON_LINKED_LIBS} -Wl,--hash-style=both -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libunwind.a"
echo "${ARCH_FLAGS} ${OPTIMIZATION_FLAGS} ${COMMON_LINKED_LIBS} ${EXTRA_LDFLAGS} -Wl,--hash-style=both -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libunwind.a"
}

create_mason_cross_file() {
Expand Down
30 changes: 15 additions & 15 deletions scripts/function-ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ get_cflags() {
local MIN_VERSION_FLAGS=$(get_min_version_cflags "$1")
local COMMON_INCLUDES=$(get_common_includes)

echo "${ARCH_FLAGS} ${APP_FLAGS} ${COMMON_FLAGS} ${OPTIMIZATION_FLAGS} ${MIN_VERSION_FLAGS} ${COMMON_INCLUDES}"
echo "${ARCH_FLAGS} ${APP_FLAGS} ${COMMON_FLAGS} ${OPTIMIZATION_FLAGS} ${MIN_VERSION_FLAGS} ${COMMON_INCLUDES} ${EXTRA_CFLAGS}"
}

get_asmflags() {
Expand Down Expand Up @@ -291,32 +291,32 @@ get_cxxflags() {
esac

case $1 in
x265)
echo "-std=c++11 -fno-exceptions ${BITCODE_FLAGS} ${COMMON_CFLAGS}"
;;
gnutls)
echo "-std=c++11 -fno-rtti ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS}"
echo "-std=c++11 -fno-rtti ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
libaom)
echo "-std=c++11 -fno-exceptions ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS}"
echo "-std=c++11 -fno-exceptions ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
libilbc)
echo "-std=c++14 -fno-exceptions -fno-rtti ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS}"
echo "-std=c++14 -fno-exceptions -fno-rtti ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
libwebp | xvidcore)
echo "-std=c++11 -fno-exceptions -fno-rtti ${BITCODE_FLAGS} -fno-common -DPIC ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS}"
echo "-std=c++11 -fno-exceptions -fno-rtti ${BITCODE_FLAGS} -fno-common -DPIC ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
opencore-amr)
echo "-fno-rtti ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS}"
echo "-fno-rtti ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
rubberband)
echo "-fno-rtti -Wno-c++11-narrowing ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS}"
echo "-fno-rtti -Wno-c++11-narrowing ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
srt | tesseract | zimg)
echo "-std=c++11 ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS}"
echo "-std=c++11 ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
x265)
echo "-std=c++11 -fno-exceptions ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${EXTRA_CXXFLAGS}"
;;
*)
echo "-std=c++11 -fno-exceptions -fno-rtti ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS}"
echo "-std=c++11 -fno-exceptions -fno-rtti ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
esac
}
Expand Down Expand Up @@ -409,16 +409,16 @@ get_ldflags() {
ffmpeg-kit)
case ${ARCH} in
armv7 | armv7s | arm64 | arm64e | *-mac-catalyst)
echo "${ARCH_FLAGS} ${LINKED_LIBRARIES} ${COMMON_FLAGS} ${BITCODE_FLAGS} ${OPTIMIZATION_FLAGS}"
echo "${ARCH_FLAGS} ${LINKED_LIBRARIES} ${COMMON_FLAGS} ${BITCODE_FLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_LDFLAGS}"
;;
*)
echo "${ARCH_FLAGS} ${LINKED_LIBRARIES} ${COMMON_FLAGS} ${OPTIMIZATION_FLAGS}"
echo "${ARCH_FLAGS} ${LINKED_LIBRARIES} ${COMMON_FLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_LDFLAGS}"
;;
esac
;;
*)
# NOTE THAT ffmpeg ALSO NEEDS BITCODE, IT IS ENABLED IN ffmpeg.sh
echo "${ARCH_FLAGS} ${LINKED_LIBRARIES} ${COMMON_FLAGS} ${OPTIMIZATION_FLAGS}"
echo "${ARCH_FLAGS} ${LINKED_LIBRARIES} ${COMMON_FLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_LDFLAGS}"
;;
esac
}
Expand Down
10 changes: 5 additions & 5 deletions scripts/function-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ get_cflags() {
fi
local COMMON_INCLUDES=$(get_common_includes)

echo "${ARCH_FLAGS} ${APP_FLAGS} ${COMMON_FLAGS} ${OPTIMIZATION_FLAGS} ${COMMON_INCLUDES}"
echo "${ARCH_FLAGS} ${APP_FLAGS} ${COMMON_FLAGS} ${OPTIMIZATION_FLAGS} ${COMMON_INCLUDES} ${EXTRA_CFLAGS}"
}

get_cxxflags() {
Expand All @@ -322,14 +322,14 @@ get_cxxflags() {
fi

local BUILD_DATE="-DFFMPEG_KIT_BUILD_DATE=$(date +%Y%m%d 2>>"${BASEDIR}"/build.log)"
local COMMON_FLAGS="-stdlib=libstdc++ -std=c++11 ${OPTIMIZATION_FLAGS} ${BUILD_DATE} $(get_arch_specific_cflags)"
local COMMON_FLAGS="-stdlib=libstdc++ -std=c++11 ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS} ${BUILD_DATE} $(get_arch_specific_cflags)"

case $1 in
ffmpeg)
if [[ -z ${FFMPEG_KIT_DEBUG} ]]; then
echo "${LINK_TIME_OPTIMIZATION_FLAGS} -stdlib=libstdc++ -std=c++11 -O2 -ffunction-sections -fdata-sections"
echo "${LINK_TIME_OPTIMIZATION_FLAGS} -stdlib=libstdc++ -std=c++11 -O2 -ffunction-sections -fdata-sections ${EXTRA_CXXFLAGS}"
else
echo "${FFMPEG_KIT_DEBUG} -stdlib=libstdc++ -std=c++11"
echo "${FFMPEG_KIT_DEBUG} -stdlib=libstdc++ -std=c++11 ${EXTRA_CXXFLAGS}"
fi
;;
ffmpeg-kit)
Expand Down Expand Up @@ -395,7 +395,7 @@ get_ldflags() {
fi
local COMMON_LINKED_LIBS=$(get_common_linked_libraries "$1")

echo "${ARCH_FLAGS} ${OPTIMIZATION_FLAGS} ${COMMON_LINKED_LIBS} ${LLVM_CONFIG_LDFLAGS} -Wl,--hash-style=both -fuse-ld=lld"
echo "${ARCH_FLAGS} ${OPTIMIZATION_FLAGS} ${COMMON_LINKED_LIBS} ${EXTRA_LDFLAGS} ${LLVM_CONFIG_LDFLAGS} -Wl,--hash-style=both -fuse-ld=lld"
}

create_mason_cross_file() {
Expand Down
26 changes: 13 additions & 13 deletions scripts/function-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ get_cflags() {
local MIN_VERSION_FLAGS=$(get_min_version_cflags "$1")
local COMMON_INCLUDES=$(get_common_includes)

echo "${ARCH_FLAGS} ${APP_FLAGS} ${COMMON_FLAGS} ${OPTIMIZATION_FLAGS} ${MIN_VERSION_FLAGS} ${COMMON_INCLUDES}"
echo "${ARCH_FLAGS} ${APP_FLAGS} ${COMMON_FLAGS} ${OPTIMIZATION_FLAGS} ${MIN_VERSION_FLAGS} ${COMMON_INCLUDES} ${EXTRA_CFLAGS}"
}

get_asmflags() {
Expand Down Expand Up @@ -225,31 +225,31 @@ get_cxxflags() {

case $1 in
gnutls)
echo "-std=c++11 -fno-rtti ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS}"
echo "-std=c++11 -fno-rtti ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
libaom)
echo "-std=c++11 -fno-exceptions ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS}"
echo "-std=c++11 -fno-exceptions ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
libilbc)
echo "-std=c++14 -fno-exceptions ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS}"
echo "-std=c++14 -fno-exceptions ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
libwebp | xvidcore)
echo "-std=c++11 -fno-exceptions -fno-rtti ${BITCODE_FLAGS} -fno-common -DPIC ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS}"
echo "-std=c++11 -fno-exceptions -fno-rtti ${BITCODE_FLAGS} -fno-common -DPIC ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
opencore-amr)
echo "-fno-rtti ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS}"
echo "-fno-rtti ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
rubberband)
echo "-fno-rtti -Wno-c++11-narrowing ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS}"
echo "-fno-rtti -Wno-c++11-narrowing ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
srt | tesseract | zimg)
echo "-std=c++11 ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS}"
echo "-std=c++11 ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
x265)
echo "-std=c++11 -fno-exceptions ${BITCODE_FLAGS} ${COMMON_CFLAGS}"
echo "-std=c++11 -fno-exceptions ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${EXTRA_CXXFLAGS}"
;;
*)
echo "-std=c++11 -fno-exceptions -fno-rtti ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS}"
echo "-std=c++11 -fno-exceptions -fno-rtti ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
esac
}
Expand Down Expand Up @@ -308,15 +308,15 @@ get_ldflags() {
ffmpeg-kit)
case ${ARCH} in
arm64)
echo "${ARCH_FLAGS} ${LINKED_LIBRARIES} ${COMMON_FLAGS} ${OPTIMIZATION_FLAGS}"
echo "${ARCH_FLAGS} ${LINKED_LIBRARIES} ${COMMON_FLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_LDFLAGS}"
;;
x86-64)
echo "${ARCH_FLAGS} ${LINKED_LIBRARIES} ${COMMON_FLAGS} ${OPTIMIZATION_FLAGS}"
echo "${ARCH_FLAGS} ${LINKED_LIBRARIES} ${COMMON_FLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_LDFLAGS}"
;;
esac
;;
*)
echo "${ARCH_FLAGS} ${LINKED_LIBRARIES} ${COMMON_FLAGS} ${OPTIMIZATION_FLAGS}"
echo "${ARCH_FLAGS} ${LINKED_LIBRARIES} ${COMMON_FLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_LDFLAGS}"
;;
esac
}
Expand Down
26 changes: 13 additions & 13 deletions scripts/function-tvos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ get_cflags() {
local MIN_VERSION_FLAGS=$(get_min_version_cflags "$1")
local COMMON_INCLUDES=$(get_common_includes)

echo "${ARCH_FLAGS} ${APP_FLAGS} ${COMMON_FLAGS} ${OPTIMIZATION_FLAGS} ${MIN_VERSION_FLAGS} ${COMMON_INCLUDES}"
echo "${ARCH_FLAGS} ${APP_FLAGS} ${COMMON_FLAGS} ${OPTIMIZATION_FLAGS} ${MIN_VERSION_FLAGS} ${COMMON_INCLUDES} ${EXTRA_CFLAGS}"
}

get_asmflags() {
Expand Down Expand Up @@ -268,31 +268,31 @@ get_cxxflags() {

case $1 in
gnutls)
echo "-std=c++11 -fno-rtti ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS}"
echo "-std=c++11 -fno-rtti ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
libaom)
echo "-std=c++11 -fno-exceptions ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS}"
echo "-std=c++11 -fno-exceptions ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
libilbc)
echo "-std=c++14 -fno-exceptions ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS}"
echo "-std=c++14 -fno-exceptions ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
libwebp | xvidcore)
echo "-std=c++11 -fno-exceptions -fno-rtti ${BITCODE_FLAGS} -fno-common -DPIC ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS}"
echo "-std=c++11 -fno-exceptions -fno-rtti ${BITCODE_FLAGS} -fno-common -DPIC ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
opencore-amr)
echo "-fno-rtti ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS}"
echo "-fno-rtti ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
rubberband)
echo "-fno-rtti -Wno-c++11-narrowing ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS}"
echo "-fno-rtti -Wno-c++11-narrowing ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
srt | tesseract | zimg)
echo "-std=c++11 ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS}"
echo "-std=c++11 ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
x265)
echo "-std=c++11 -fno-exceptions ${BITCODE_FLAGS} ${COMMON_CFLAGS}"
echo "-std=c++11 -fno-exceptions ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${EXTRA_CXXFLAGS}"
;;
*)
echo "-std=c++11 -fno-exceptions -fno-rtti ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS}"
echo "-std=c++11 -fno-exceptions -fno-rtti ${BITCODE_FLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_CXXFLAGS}"
;;
esac
}
Expand Down Expand Up @@ -371,16 +371,16 @@ get_ldflags() {
ffmpeg-kit)
case ${ARCH} in
arm64)
echo "${ARCH_FLAGS} ${LINKED_LIBRARIES} ${COMMON_FLAGS} ${BITCODE_FLAGS} ${OPTIMIZATION_FLAGS}"
echo "${ARCH_FLAGS} ${LINKED_LIBRARIES} ${COMMON_FLAGS} ${BITCODE_FLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_LDFLAGS}"
;;
*)
echo "${ARCH_FLAGS} ${LINKED_LIBRARIES} ${COMMON_FLAGS} ${OPTIMIZATION_FLAGS}"
echo "${ARCH_FLAGS} ${LINKED_LIBRARIES} ${COMMON_FLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_LDFLAGS}"
;;
esac
;;
*)
# NOTE THAT ffmpeg ALSO NEEDS BITCODE, IT IS ENABLED IN ffmpeg.sh
echo "${ARCH_FLAGS} ${LINKED_LIBRARIES} ${COMMON_FLAGS} ${OPTIMIZATION_FLAGS}"
echo "${ARCH_FLAGS} ${LINKED_LIBRARIES} ${COMMON_FLAGS} ${OPTIMIZATION_FLAGS} ${EXTRA_LDFLAGS}"
;;
esac
}
Expand Down
12 changes: 12 additions & 0 deletions tvos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,18 @@ while [ ! $# -eq 0 ]; do

export TVOS_MIN_VERSION=${TARGET}
;;
--extra-cflags=*)
EXTRA_CFLAGS=$(echo $1 | sed -e 's/^--extra-cflags=//g')
export EXTRA_CFLAGS="${EXTRA_CFLAGS}"
;;
--extra-cxxflags=*)
EXTRA_CXXFLAGS=$(echo $1 | sed -e 's/^--extra-cxxflags=//g')
export EXTRA_CXXFLAGS="${EXTRA_CXXFLAGS}"
;;
--extra-ldflags=*)
EXTRA_LDFLAGS=$(echo $1 | sed -e 's/^--extra-ldflags=//g')
export EXTRA_LDFLAGS="${EXTRA_LDFLAGS}"
;;
*)
print_unknown_option "$1"
;;
Expand Down

0 comments on commit 8d2c693

Please sign in to comment.