|
|
@ -21,10 +21,11 @@ option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON)
|
|
|
|
option(ENABLE_CUBEB "Enables the cubeb audio backend" ON)
|
|
|
|
option(ENABLE_CUBEB "Enables the cubeb audio backend" ON)
|
|
|
|
|
|
|
|
|
|
|
|
option(ENABLE_FFMPEG "Enable FFmpeg decoder/encoder" OFF)
|
|
|
|
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(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF)
|
|
|
|
option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF)
|
|
|
|
|
|
|
|
|
|
|
|
CMAKE_DEPENDENT_OPTION(ENABLE_MF "Use Media Foundation decoder" ON "WIN32;NOT ENABLE_FFMPEG" OFF)
|
|
|
|
CMAKE_DEPENDENT_OPTION(ENABLE_MF "Use Media Foundation decoder (preferred over FFmpeg)" ON "WIN32" OFF)
|
|
|
|
|
|
|
|
|
|
|
|
if(NOT EXISTS ${PROJECT_SOURCE_DIR}/.git/hooks/pre-commit)
|
|
|
|
if(NOT EXISTS ${PROJECT_SOURCE_DIR}/.git/hooks/pre-commit)
|
|
|
|
message(STATUS "Copying pre-commit hook")
|
|
|
|
message(STATUS "Copying pre-commit hook")
|
|
|
@ -189,26 +190,23 @@ endif()
|
|
|
|
if (ENABLE_FFMPEG)
|
|
|
|
if (ENABLE_FFMPEG)
|
|
|
|
if (CITRA_USE_BUNDLED_FFMPEG)
|
|
|
|
if (CITRA_USE_BUNDLED_FFMPEG)
|
|
|
|
if ((MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1930) AND ARCHITECTURE_x86_64)
|
|
|
|
if ((MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1930) AND ARCHITECTURE_x86_64)
|
|
|
|
set(FFmpeg_VER "ffmpeg-4.0.2-msvc")
|
|
|
|
set(FFmpeg_VER "ffmpeg-4.1-win64")
|
|
|
|
else()
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "No bundled FFmpeg binaries for your toolchain. Disable CITRA_USE_BUNDLED_FFMPEG and provide your own.")
|
|
|
|
message(FATAL_ERROR "No bundled FFmpeg binaries for your toolchain. Disable CITRA_USE_BUNDLED_FFMPEG and provide your own.")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
if (DEFINED FFmpeg_VER)
|
|
|
|
if (DEFINED FFmpeg_VER)
|
|
|
|
download_bundled_external("ffmpeg/" ${FFmpeg_VER} FFmpeg_PREFIX)
|
|
|
|
download_bundled_external("ffmpeg/" ${FFmpeg_VER} FFmpeg_PREFIX)
|
|
|
|
set(FFMPEG_DIR "${FFmpeg_PREFIX}/../")
|
|
|
|
set(FFMPEG_DIR "${FFmpeg_PREFIX}")
|
|
|
|
set(FFMPEG_FOUND YES)
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
else()
|
|
|
|
|
|
|
|
find_package(FFmpeg REQUIRED COMPONENTS avcodec)
|
|
|
|
|
|
|
|
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).")
|
|
|
|
|
|
|
|
else()
|
|
|
|
|
|
|
|
set(FFMPEG_FOUND YES)
|
|
|
|
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
|
|
|
|
set(FFMPEG_FOUND NO)
|
|
|
|
find_package(FFmpeg REQUIRED COMPONENTS avcodec avformat avutil swscale swresample)
|
|
|
|
|
|
|
|
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()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
add_definitions(-DENABLE_FFMPEG)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# Platform-specific library requirements
|
|
|
|
# Platform-specific library requirements
|
|
|
|