From 90437d15743f506d68c8cfddbd8b8d9e68da857a Mon Sep 17 00:00:00 2001 From: nonoteal Date: Fri, 1 Oct 2021 18:49:25 -1000 Subject: [PATCH] Change how FFmpeg is imported for Apple computers. Imports Apple libraries and also pulls swresample in, so when compiling Dolphin doesn't throw undefined symbols. --- CMakeLists.txt | 8 +++++++- Source/Core/VideoCommon/CMakeLists.txt | 9 +++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b9f8ae348d..5e667a772f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -488,8 +488,14 @@ if(ENCODE_FRAMEDUMPS) if(WIN32 AND _M_X86_64) set(FFMPEG_DIR Externals/ffmpeg) endif() - find_package(FFmpeg COMPONENTS avcodec avformat avutil swscale) + find_package(FFmpeg COMPONENTS avcodec avformat avutil swresample swscale) if(FFmpeg_FOUND) + if(APPLE) + find_library(COREMEDIA_LIBRARY CoreMedia) + find_library(VIDEOTOOLBOX_LIBRARY VideoToolbox) + find_library(COREVIDEO_LIBRARY CoreVideo) + find_library(AUDIOTOOLBOX_LIBRARY AudioToolbox) + endif() message(STATUS "libav/ffmpeg found, enabling AVI frame dumps") add_definitions(-DHAVE_FFMPEG) else() diff --git a/Source/Core/VideoCommon/CMakeLists.txt b/Source/Core/VideoCommon/CMakeLists.txt index d9fe3ff1f9..7890185f97 100644 --- a/Source/Core/VideoCommon/CMakeLists.txt +++ b/Source/Core/VideoCommon/CMakeLists.txt @@ -167,6 +167,15 @@ if(FFmpeg_FOUND) FFmpeg::avcodec FFmpeg::avformat FFmpeg::avutil + FFmpeg::swresample FFmpeg::swscale ) + if(APPLE) + target_link_libraries(videocommon PRIVATE + ${COREMEDIA_LIBRARY} + ${VIDEOTOOLBOX_LIBRARY} + ${COREVIDEO_LIBRARY} + ${AUDIOTOOLBOX_LIBRARY} + ) + endif() endif()