CMake: separate options for FFmpeg decoder/dumper

Separate options are now provided for FFmpeg AAC audio decoder and FFmpeg video dumper. This allows users to configure Citra with greater freedom.

Also, previously for Linux builds, AAC decoder is accidentally enabled along with the dumper, which could potentially cause patent issues (?). This commit fixes it by only enabling video dumper.
This commit is contained in:
zhupengfei 2019-08-20 14:45:39 +08:00
parent 1cf75e55c2
commit f8b3950829
No known key found for this signature in database
GPG key ID: DD129E108BD09378
10 changed files with 18 additions and 15 deletions

View file

@ -20,8 +20,9 @@ option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON)
option(ENABLE_CUBEB "Enables the cubeb audio backend" ON)
option(ENABLE_FFMPEG "Enable FFmpeg decoder/encoder" OFF)
CMAKE_DEPENDENT_OPTION(CITRA_USE_BUNDLED_FFMPEG "Download bundled FFmpeg binaries" ON "ENABLE_FFMPEG;MSVC" OFF)
option(ENABLE_FFMPEG_AUDIO_DECODER "Enable FFmpeg audio (AAC) decoder" OFF)
option(ENABLE_FFMPEG_VIDEO_DUMPER "Enable FFmpeg video dumper" OFF)
CMAKE_DEPENDENT_OPTION(CITRA_USE_BUNDLED_FFMPEG "Download bundled FFmpeg binaries" ON "ENABLE_FFMPEG_AUDIO_DECODER OR ENABLE_FFMPEG_VIDEO_DUMPING;MSVC" OFF)
option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF)
@ -189,7 +190,7 @@ if (ENABLE_QT)
endif()
endif()
if (ENABLE_FFMPEG)
if (ENABLE_FFMPEG_AUDIO_DECODER OR ENABLE_FFMPEG_VIDEO_DUMPER)
if (CITRA_USE_BUNDLED_FFMPEG)
if ((MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1930) AND ARCHITECTURE_x86_64)
set(FFmpeg_VER "ffmpeg-4.1-win64")
@ -207,8 +208,10 @@ if (ENABLE_FFMPEG)
if ("${FFmpeg_avcodec_VERSION}" VERSION_LESS "57.48.101")
message(FATAL_ERROR "Found version for libavcodec is too low. The required version is at least 57.48.101 (included in FFmpeg 3.1 and later).")
endif()
endif()
add_definitions(-DENABLE_FFMPEG)
if (ENABLE_FFMPEG_VIDEO_DUMPER)
add_definitions(-DENABLE_FFMPEG_VIDEO_DUMPER)
endif()
# Platform-specific library requirements