aboutsummaryrefslogtreecommitdiff
path: root/tools/depends/target/ffmpeg
diff options
context:
space:
mode:
authorfuzzard <fuzzard@kodi.tv>2022-02-28 16:39:03 +1000
committerfuzzard <fuzzard@kodi.tv>2022-03-02 19:57:05 +1000
commit96dd983de67eada7c8f615bd551e2d04aa812fb3 (patch)
tree5314cc16e55b1bba0e02a67bdefbc7c548d325e3 /tools/depends/target/ffmpeg
parente0392177cc1ce07975885be409a0063c21de847f (diff)
[cmake] Refresh FindFFMPEG module to be more consistent with other find modules
FindFFMPEG refactor internal ffmpeg build to a function and allow fallback Fixup cmake for ffmpeg to allow osx use of ENABLE_INTERNAL_FFMPEG Refactor to mirror tools/depends options for cmake build introduce FindNASM module move FindGnuTLS module into project module dir
Diffstat (limited to 'tools/depends/target/ffmpeg')
-rw-r--r--tools/depends/target/ffmpeg/CMakeLists.txt77
-rw-r--r--tools/depends/target/ffmpeg/FindGnuTls.cmake27
2 files changed, 53 insertions, 51 deletions
diff --git a/tools/depends/target/ffmpeg/CMakeLists.txt b/tools/depends/target/ffmpeg/CMakeLists.txt
index f05c54a823..94689abb88 100644
--- a/tools/depends/target/ffmpeg/CMakeLists.txt
+++ b/tools/depends/target/ffmpeg/CMakeLists.txt
@@ -2,22 +2,41 @@ project(ffmpeg)
cmake_minimum_required(VERSION 2.8)
-list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
-
if(ENABLE_CCACHE AND CCACHE_PROGRAM)
- set(ffmpeg_conf "--cc=${CCACHE_PROGRAM} ${CMAKE_C_COMPILER}" "--cxx=${CCACHE_PROGRAM} ${CMAKE_CXX_COMPILER}")
+ set(ffmpeg_conf "--cc=${CCACHE_PROGRAM} ${CMAKE_C_COMPILER}"
+ "--cxx=${CCACHE_PROGRAM} ${CMAKE_CXX_COMPILER}"
+ )
else()
- set(ffmpeg_conf --cc=${CMAKE_C_COMPILER} --cxx=${CMAKE_CXX_COMPILER})
+ set(ffmpeg_conf --cc=${CMAKE_C_COMPILER}
+ --cxx=${CMAKE_CXX_COMPILER}
+ )
endif()
if(CROSSCOMPILING)
set(pkgconf "PKG_CONFIG_LIBDIR=${DEPENDS_PATH}/lib/pkgconfig")
- list(APPEND ffmpeg_conf --pkg-config=${PKG_CONFIG_EXECUTABLE} --pkg-config-flags=--static)
- list(APPEND ffmpeg_conf --enable-cross-compile --cpu=${CPU} --arch=${CPU} --target-os=${OS})
- list(APPEND ffmpeg_conf --ar=${CMAKE_AR} --strip=${CMAKE_STRIP})
+ list(APPEND ffmpeg_conf --pkg-config=${PKG_CONFIG_EXECUTABLE}
+ --pkg-config-flags=--static
+ --enable-cross-compile
+ --enable-pic
+ --ar=${CMAKE_AR}
+ --strip=${CMAKE_STRIP}
+ )
+
message(STATUS "CROSS: ${ffmpeg_conf}")
endif()
+set(CONFIGARCH --arch=${CPU})
+
+list(APPEND ffmpeg_conf --disable-doc
+ --disable-devices
+ --disable-programs
+ --disable-sdl2
+ --enable-gpl
+ --enable-postproc
+ --enable-runtime-cpudetect
+ --enable-pthreads
+ )
+
if(CMAKE_C_FLAGS)
list(APPEND ffmpeg_conf --extra-cflags=${CMAKE_C_FLAGS})
endif()
@@ -39,7 +58,9 @@ if(CMAKE_BUILD_TYPE STREQUAL Release)
endif()
if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd)
- list(APPEND ffmpeg_conf --enable-pic)
+ list(APPEND ffmpeg_conf --enable-pic
+ --target-os=linux
+ )
if(ENABLE_VAAPI)
list(APPEND ffmpeg_conf --enable-vaapi)
else()
@@ -51,36 +72,49 @@ if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd)
list(APPEND ffmpeg_conf --disable-vdpau)
endif()
elseif(CORE_SYSTEM_NAME STREQUAL android)
+ list(APPEND ffmpeg_conf --target-os=android
+ --extra-libs=-liconv
+ --disable-linux-perf
+ )
if(CPU MATCHES arm64)
- list(APPEND ffmpeg_conf --cpu=cortex-a53 --arch=aarch64)
+ set(CONFIGARCH --arch=aarch64)
+ list(APPEND ffmpeg_conf --cpu=cortex-a53)
elseif(CPU MATCHES arm)
list(APPEND ffmpeg_conf --cpu=cortex-a9)
elseif(CPU MATCHES x86_64)
- list(APPEND ffmpeg_conf --cpu=x86_64 --enable-pic)
+ list(APPEND ffmpeg_conf --cpu=x86_64)
else()
list(APPEND ffmpeg_conf --cpu=i686 --disable-mmx)
endif()
- list(APPEND ffmpeg_conf --target-os=linux --extra-libs=-liconv --disable-linux-perf)
elseif(CORE_SYSTEM_NAME STREQUAL darwin_embedded)
- list(APPEND ffmpeg_conf --disable-crystalhd --enable-videotoolbox
- --target-os=darwin)
+ list(APPEND ffmpeg_conf --disable-crystalhd
+ --enable-videotoolbox
+ --target-os=darwin
+ --disable-securetransport
+ )
elseif(CORE_SYSTEM_NAME STREQUAL osx)
- list(APPEND ffmpeg_conf --disable-crystalhd --enable-videotoolbox
+ list(APPEND ffmpeg_conf --disable-crystalhd
+ --enable-videotoolbox
--target-os=darwin
- --disable-securetransport)
+ )
endif()
if(CPU MATCHES arm)
- list(APPEND ffmpeg_conf --enable-pic --disable-armv5te --disable-armv6t2)
+ list(APPEND ffmpeg_conf --disable-armv5te --disable-armv6t2)
elseif(CPU MATCHES mips)
list(APPEND ffmpeg_conf --disable-mips32r2 --disable-mipsdsp --disable-mipsdspr2)
endif()
-find_package(GnuTls)
+find_package(GnuTLS)
if(GNUTLS_FOUND)
list(APPEND ffmpeg_conf --enable-gnutls)
endif()
+if(CPU MATCHES x86 OR CPU MATCHES x86_64)
+ find_package(NASM REQUIRED)
+ list(APPEND ffmpeg_conf --x86asmexe=${NASM_EXECUTABLE})
+endif()
+
if(ENABLE_DAV1D)
list(APPEND ffmpeg_conf --enable-libdav1d)
set(pkgconf_path "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}")
@@ -92,6 +126,8 @@ if(EXTRA_FLAGS)
list(APPEND ffmpeg_conf ${EXTRA_FLAGS})
endif()
+list(APPEND ffmpeg_conf ${CONFIGARCH})
+
message(STATUS "FFMPEG_CONF: ${ffmpeg_conf}")
set(MAKE_COMMAND $(MAKE))
@@ -110,13 +146,6 @@ externalproject_add(ffmpeg
CONFIGURE_COMMAND ${pkgconf} ${pkgconf_path} <SOURCE_DIR>/configure
--prefix=${CMAKE_INSTALL_PREFIX}
--extra-version="kodi-${FFMPEG_VER}"
- --disable-devices
- --disable-doc
- --disable-programs
- --enable-gpl
- --enable-runtime-cpudetect
- --enable-postproc
- --enable-pthreads
${ffmpeg_conf}
BUILD_COMMAND ${MAKE_COMMAND})
diff --git a/tools/depends/target/ffmpeg/FindGnuTls.cmake b/tools/depends/target/ffmpeg/FindGnuTls.cmake
deleted file mode 100644
index 68c35d6b7e..0000000000
--- a/tools/depends/target/ffmpeg/FindGnuTls.cmake
+++ /dev/null
@@ -1,27 +0,0 @@
-# - Try to find gnutls
-# Once done this will define
-#
-# GNUTLS_FOUND - system has gnutls
-# GNUTLS_INCLUDE_DIRS - the gnutls include directory
-# GNUTLS_LIBRARIES - The gnutls libraries
-
-include(FindPkgConfig)
-find_package(PkgConfig)
-
-if(PKG_CONFIG_FOUND)
- pkg_check_modules (GNUTLS gnutls)
-endif()
-
-if(NOT GNUTLS_FOUND)
- find_path(GNUTLS_INCLUDE_DIRS gnutls/gnutls.h)
- find_library(GNUTLS_LIBRARIES gnutls)
-endif()
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(GnuTls DEFAULT_MSG GNUTLS_INCLUDE_DIRS GNUTLS_LIBRARIES)
-
-if(GNUTLS_FOUND)
- list(APPEND GNUTLS_DEFINITIONS -DHAVE_GNUTLS=1)
-endif()
-
-mark_as_advanced(GNUTLS_INCLUDE_DIRS GNUTLS_LIBRARIES GNUTLS_DEFINITIONS)