From 47401016bfbcd904edd22a4a1bf772e893ad36f6 Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Fri, 5 Feb 2021 13:45:10 -0500 Subject: CMake: Implement YUZU_USE_BUNDLED_FFMPEG For Linux, instructs CMake to use the FFmpeg submodule in externals. This is HEAVILY based on our usage of the late Unicorn. Minimal change to MSVC as it uses the yuzu-emu/ext-windows-bin. MinGW now targets the same ext-windows-bin libraries as MSVC for FFmpeg. Adds FFMPEG_LIBRARIES to WIN32 and simplifies video_core/CMakeLists.txt a bit. --- src/video_core/CMakeLists.txt | 11 +++++------ src/video_core/command_classes/codecs/codec.cpp | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src/video_core') diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index bb1f8491f..01e284d8c 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt @@ -273,14 +273,13 @@ create_target_directory_groups(video_core) target_link_libraries(video_core PUBLIC common core) target_link_libraries(video_core PRIVATE glad xbyak) -if (MSVC) - target_include_directories(video_core PRIVATE ${FFMPEG_INCLUDE_DIR}) - target_link_libraries(video_core PUBLIC ${FFMPEG_LIBRARY_DIR}/swscale.lib ${FFMPEG_LIBRARY_DIR}/avcodec.lib ${FFMPEG_LIBRARY_DIR}/avutil.lib) -else() - target_include_directories(video_core PRIVATE ${FFMPEG_INCLUDE_DIR}) - target_link_libraries(video_core PRIVATE ${FFMPEG_LIBRARIES}) +if (YUZU_USE_BUNDLED_FFMPEG AND NOT WIN32) + add_dependencies(video_core ffmpeg-build) endif() +target_include_directories(video_core PRIVATE ${FFMPEG_INCLUDE_DIR}) +target_link_libraries(video_core PRIVATE ${FFMPEG_LIBRARIES}) + add_dependencies(video_core host_shaders) target_include_directories(video_core PRIVATE ${HOST_SHADERS_INCLUDE}) target_include_directories(video_core PRIVATE sirit ../../externals/Vulkan-Headers/include) diff --git a/src/video_core/command_classes/codecs/codec.cpp b/src/video_core/command_classes/codecs/codec.cpp index 39bc923a5..c25d2ad2c 100644 --- a/src/video_core/command_classes/codecs/codec.cpp +++ b/src/video_core/command_classes/codecs/codec.cpp @@ -13,7 +13,7 @@ #include "video_core/memory_manager.h" extern "C" { -#include +#include "libavutil/opt.h" } namespace Tegra { -- cgit v1.2.3 From 1d19eac415199bd4c768f1cbebc9f23298734545 Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Fri, 5 Feb 2021 15:39:19 -0500 Subject: CMake: Port citra-emu/citra FindFFmpeg.cmake Also renames related CMake variables to match both the Find*FFmpeg* and variables defined within the file. Fixes odd errors produced by the old FindFFmpeg. Citra's FindFFmpeg is slightly modified here: adds Citra's copyright at the beginning, renames FFmpeg_INCLUDES to FFmpeg_INCLUDE_DIR, disables a few components in _FFmpeg_ALL_COMPONENTS, and adds the missing avutil component to the comment above. --- src/video_core/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/video_core') diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index 01e284d8c..1434d0260 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt @@ -277,8 +277,8 @@ if (YUZU_USE_BUNDLED_FFMPEG AND NOT WIN32) add_dependencies(video_core ffmpeg-build) endif() -target_include_directories(video_core PRIVATE ${FFMPEG_INCLUDE_DIR}) -target_link_libraries(video_core PRIVATE ${FFMPEG_LIBRARIES}) +target_include_directories(video_core PRIVATE ${FFmpeg_INCLUDE_DIR}) +target_link_libraries(video_core PRIVATE ${FFmpeg_LIBRARIES}) add_dependencies(video_core host_shaders) target_include_directories(video_core PRIVATE ${HOST_SHADERS_INCLUDE}) -- cgit v1.2.3 From b7e6eca8b21cdfee5bec6734657314822bccb2e1 Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Fri, 5 Feb 2021 16:46:03 -0500 Subject: Address reviewer comments --- src/video_core/command_classes/codecs/codec.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/video_core') diff --git a/src/video_core/command_classes/codecs/codec.cpp b/src/video_core/command_classes/codecs/codec.cpp index c25d2ad2c..39bc923a5 100644 --- a/src/video_core/command_classes/codecs/codec.cpp +++ b/src/video_core/command_classes/codecs/codec.cpp @@ -13,7 +13,7 @@ #include "video_core/memory_manager.h" extern "C" { -#include "libavutil/opt.h" +#include } namespace Tegra { -- cgit v1.2.3