summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Ameer J2021-02-08 21:13:10 -0500
committerGravatar GitHub2021-02-08 21:13:10 -0500
commit26669d9e134d2f5ce0ff75b23af5719b6521c68b (patch)
tree94fd14bc2646bb1215006483999970cb04d2a7e3
parentMerge pull request #5892 from german77/backup (diff)
parentffmpeg: Checkout tag n4.3.1 (diff)
downloadyuzu-26669d9e134d2f5ce0ff75b23af5719b6521c68b.tar.gz
yuzu-26669d9e134d2f5ce0ff75b23af5719b6521c68b.tar.xz
yuzu-26669d9e134d2f5ce0ff75b23af5719b6521c68b.zip
Merge pull request #5880 from lat9nq/ffmpeg-external
cmake: FFmpeg linking rework
-rwxr-xr-x.ci/scripts/windows/docker.sh5
-rw-r--r--.gitmodules3
-rw-r--r--CMakeLists.txt146
m---------externals/ffmpeg0
-rw-r--r--externals/find-modules/FindFFmpeg.cmake247
-rw-r--r--src/video_core/CMakeLists.txt11
6 files changed, 315 insertions, 97 deletions
diff --git a/.ci/scripts/windows/docker.sh b/.ci/scripts/windows/docker.sh
index 2bc9f36ab..192a01fd8 100755
--- a/.ci/scripts/windows/docker.sh
+++ b/.ci/scripts/windows/docker.sh
@@ -42,3 +42,8 @@ done
42pip3 install pefile 42pip3 install pefile
43python3 .ci/scripts/windows/scan_dll.py package/*.exe "package/" 43python3 .ci/scripts/windows/scan_dll.py package/*.exe "package/"
44python3 .ci/scripts/windows/scan_dll.py package/imageformats/*.dll "package/" 44python3 .ci/scripts/windows/scan_dll.py package/imageformats/*.dll "package/"
45
46# copy FFmpeg libraries
47EXTERNALS_PATH="$(pwd)/build/externals"
48FFMPEG_DLL_PATH="$(find ${EXTERNALS_PATH} -maxdepth 1 -type d | grep ffmpeg)/bin"
49find ${FFMPEG_DLL_PATH} -type f -regex ".*\.dll" -exec cp -v {} package/ ';'
diff --git a/.gitmodules b/.gitmodules
index 41022615b..4962f7bfd 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -37,3 +37,6 @@
37[submodule "opus"] 37[submodule "opus"]
38 path = externals/opus/opus 38 path = externals/opus/opus
39 url = https://github.com/xiph/opus.git 39 url = https://github.com/xiph/opus.git
40[submodule "externals/ffmpeg"]
41 path = externals/ffmpeg
42 url = https://git.ffmpeg.org/ffmpeg.git
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 27aa56780..ac7c3ce90 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,6 +18,8 @@ CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" ON "EN
18 18
19option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON) 19option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON)
20 20
21CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_FFMPEG "Download/Build bundled yuzu" ON "WIN32" OFF)
22
21option(YUZU_USE_QT_WEB_ENGINE "Use QtWebEngine for web applet implementation" OFF) 23option(YUZU_USE_QT_WEB_ENGINE "Use QtWebEngine for web applet implementation" OFF)
22 24
23option(YUZU_ENABLE_BOXCAT "Enable the Boxcat service, a yuzu high-level implementation of BCAT" ON) 25option(YUZU_ENABLE_BOXCAT "Enable the Boxcat service, a yuzu high-level implementation of BCAT" ON)
@@ -384,19 +386,141 @@ if (NOT LIBUSB_FOUND)
384 set(LIBUSB_LIBRARIES usb) 386 set(LIBUSB_LIBRARIES usb)
385endif() 387endif()
386 388
387# Use system installed ffmpeg. 389# List of all FFmpeg components required
388if (NOT MSVC) 390set(FFmpeg_COMPONENTS
389 find_package(FFmpeg REQUIRED) 391 avcodec
390else() 392 avutil
391 set(FFMPEG_EXT_NAME "ffmpeg-4.2.1") 393 swscale)
392 set(FFMPEG_PATH "${CMAKE_BINARY_DIR}/externals/${FFMPEG_EXT_NAME}") 394
393 download_bundled_external("ffmpeg/" ${FFMPEG_EXT_NAME} "") 395if (NOT YUZU_USE_BUNDLED_FFMPEG)
394 set(FFMPEG_FOUND YES) 396 # Use system installed FFmpeg
395 set(FFMPEG_INCLUDE_DIR "${FFMPEG_PATH}/include" CACHE PATH "Path to FFmpeg headers" FORCE) 397 find_package(FFmpeg REQUIRED COMPONENTS ${FFmpeg_COMPONENTS})
396 set(FFMPEG_LIBRARY_DIR "${FFMPEG_PATH}/bin" CACHE PATH "Path to FFmpeg library" FORCE) 398
397 set(FFMPEG_DLL_DIR "${FFMPEG_PATH}/bin" CACHE PATH "Path to FFmpeg dll's" FORCE) 399 if (FFmpeg_FOUND)
400 # Overwrite aggregate defines from FFmpeg module to avoid over-linking libraries.
401 # Prevents shipping too many libraries with the AppImage.
402 set(FFmpeg_LIBRARIES "")
403 set(FFmpeg_INCLUDE_DIR "")
404
405 foreach(COMPONENT ${FFmpeg_COMPONENTS})
406 set(FFmpeg_LIBRARIES ${FFmpeg_LIBRARIES} ${FFmpeg_LIBRARY_${COMPONENT}} CACHE PATH "Paths to FFmpeg libraries" FORCE)
407 set(FFmpeg_INCLUDE_DIR ${FFmpeg_INCLUDE_DIR} ${FFmpeg_INCLUDE_${COMPONENT}} CACHE PATH "Path to FFmpeg headers" FORCE)
408 endforeach()
409 else()
410 message(WARNING "FFmpeg not found, falling back to externals")
411 set(YUZU_USE_BUNDLED_FFMPEG ON)
412 endif()
413endif()
414
415if (YUZU_USE_BUNDLED_FFMPEG)
416 if (NOT WIN32)
417 # Build FFmpeg from externals
418 message(STATUS "Using FFmpeg from externals")
419
420 # FFmpeg has source that requires one of nasm or yasm to assemble it.
421 # REQUIRED throws an error if not found here during configuration rather than during compilation.
422 find_program(ASSEMBLER NAMES nasm yasm REQUIRED)
423
424 set(FFmpeg_PREFIX ${PROJECT_SOURCE_DIR}/externals/ffmpeg)
425 set(FFmpeg_BUILD_DIR ${PROJECT_BINARY_DIR}/externals/ffmpeg)
426 set(FFmpeg_MAKEFILE ${FFmpeg_BUILD_DIR}/Makefile)
427 make_directory(${FFmpeg_BUILD_DIR})
428
429 # Read version string from external
430 file(READ ${FFmpeg_PREFIX}/RELEASE FFmpeg_VERSION)
431 set(FFmpeg_FOUND NO)
432 if (NOT FFmpeg_VERSION STREQUAL "")
433 set(FFmpeg_FOUND YES)
434 endif()
435
436 foreach(COMPONENT ${FFmpeg_COMPONENTS})
437 set(FFmpeg_${COMPONENT}_PREFIX "${FFmpeg_BUILD_DIR}/lib${COMPONENT}")
438 set(FFmpeg_${COMPONENT}_LIB_NAME "lib${COMPONENT}.a")
439 set(FFmpeg_${COMPONENT}_LIBRARY "${FFmpeg_${COMPONENT}_PREFIX}/${FFmpeg_${COMPONENT}_LIB_NAME}")
440
441 set(FFmpeg_LIBRARIES
442 ${FFmpeg_LIBRARIES}
443 ${FFmpeg_${COMPONENT}_LIBRARY}
444 CACHE PATH "Paths to FFmpeg libraries" FORCE)
445 endforeach()
446
447 set(FFmpeg_INCLUDE_DIR
448 ${FFmpeg_PREFIX}
449 CACHE PATH "Path to FFmpeg headers" FORCE)
450
451 # `configure` parameters builds only exactly what yuzu needs from FFmpeg
452 # `--disable-{vaapi,vdpau}` is needed to avoid linking issues
453 add_custom_command(
454 OUTPUT
455 ${FFmpeg_MAKEFILE}
456 COMMAND
457 /bin/bash ${FFmpeg_PREFIX}/configure
458 --disable-avdevice
459 --disable-avfilter
460 --disable-avformat
461 --disable-doc
462 --disable-everything
463 --disable-ffmpeg
464 --disable-ffprobe
465 --disable-network
466 --disable-postproc
467 --disable-swresample
468 --disable-vaapi
469 --disable-vdpau
470 --enable-decoder=h264
471 --enable-decoder=vp9
472 WORKING_DIRECTORY
473 ${FFmpeg_BUILD_DIR}
474 )
475
476 # Workaround for Ubuntu 18.04's older version of make not being able to call make as a child
477 # with context of the jobserver. Also helps ninja users.
478 execute_process(
479 COMMAND
480 nproc
481 OUTPUT_VARIABLE
482 SYSTEM_THREADS)
483
484 add_custom_command(
485 OUTPUT
486 ${FFmpeg_LIBRARIES}
487 COMMAND
488 make -j${SYSTEM_THREADS}
489 WORKING_DIRECTORY
490 ${FFmpeg_BUILD_DIR}
491 )
492
493 # ALL makes this custom target build every time
494 # but it won't actually build if the DEPENDS parameter is up to date
495 add_custom_target(ffmpeg-build ALL DEPENDS ${FFmpeg_LIBRARIES})
496 add_custom_target(ffmpeg-configure ALL DEPENDS ${FFmpeg_MAKEFILE})
497
498 if (FFmpeg_FOUND)
499 message(STATUS "Found FFmpeg version ${FFmpeg_VERSION}")
500
501 add_dependencies(ffmpeg-build ffmpeg-configure)
502 else()
503 message(FATAL_ERROR "FFmpeg not found")
504 endif()
505 else() # WIN32
506 # Use yuzu FFmpeg binaries
507 set(FFmpeg_EXT_NAME "ffmpeg-4.3.1")
508 set(FFmpeg_PATH "${CMAKE_BINARY_DIR}/externals/${FFmpeg_EXT_NAME}")
509 download_bundled_external("ffmpeg/" ${FFmpeg_EXT_NAME} "")
510 set(FFmpeg_FOUND YES)
511 set(FFmpeg_INCLUDE_DIR "${FFmpeg_PATH}/include" CACHE PATH "Path to FFmpeg headers" FORCE)
512 set(FFmpeg_LIBRARY_DIR "${FFmpeg_PATH}/bin" CACHE PATH "Path to FFmpeg library directory" FORCE)
513 set(FFmpeg_DLL_DIR "${FFmpeg_PATH}/bin" CACHE PATH "Path to FFmpeg dll's" FORCE)
514 set(FFmpeg_LIBRARIES
515 ${FFmpeg_LIBRARY_DIR}/swscale.lib
516 ${FFmpeg_LIBRARY_DIR}/avcodec.lib
517 ${FFmpeg_LIBRARY_DIR}/avutil.lib
518 CACHE PATH "Paths to FFmpeg libraries" FORCE)
519 endif()
398endif() 520endif()
399 521
522unset(FFmpeg_COMPONENTS)
523
400# Prefer the -pthread flag on Linux. 524# Prefer the -pthread flag on Linux.
401set(THREADS_PREFER_PTHREAD_FLAG ON) 525set(THREADS_PREFER_PTHREAD_FLAG ON)
402find_package(Threads REQUIRED) 526find_package(Threads REQUIRED)
diff --git a/externals/ffmpeg b/externals/ffmpeg
new file mode 160000
Subproject 6b6b9e593dd4d3aaf75f48d40a13ef03bdef9fd
diff --git a/externals/find-modules/FindFFmpeg.cmake b/externals/find-modules/FindFFmpeg.cmake
index 77b331e00..61b6dc8d2 100644
--- a/externals/find-modules/FindFFmpeg.cmake
+++ b/externals/find-modules/FindFFmpeg.cmake
@@ -1,100 +1,187 @@
1# - Try to find ffmpeg libraries (libavcodec, libavformat and libavutil) 1# FindFFmpeg
2# Once done this will define 2# ----------
3# 3#
4# FFMPEG_FOUND - system has ffmpeg or libav 4# Copyright 2019 Citra Emulator Project
5# FFMPEG_INCLUDE_DIR - the ffmpeg include directory 5# Licensed under GPLv2 or any later version
6# FFMPEG_LIBRARIES - Link these to use ffmpeg
7# FFMPEG_LIBAVCODEC
8# FFMPEG_LIBAVFORMAT
9# FFMPEG_LIBAVUTIL
10# 6#
11# Copyright (c) 2008 Andreas Schneider <mail@cynapses.org> 7# Find the native FFmpeg includes and libraries
12# Modified for other libraries by Lasse Kärkkäinen <tronic>
13# Modified for Hedgewars by Stepik777
14# Modified for FFmpeg-example Tuukka Pasanen 2018
15# Modified for yuzu toastUnlimted 2020
16# 8#
17# Redistribution and use is allowed according to the terms of the New 9# This module defines the following variables:
18# BSD license. 10#
11# FFmpeg_INCLUDE_<component>: where to find <component>.h
12# FFmpeg_LIBRARY_<component>: where to find the <component> library
13# FFmpeg_INCLUDE_DIR: aggregate all the include paths
14# FFmpeg_LIBRARIES: aggregate all the paths to the libraries
15# FFmpeg_FOUND: True if all components have been found
16#
17# This module defines the following targets, which are prefered over variables:
18#
19# FFmpeg::<component>: Target to use <component> directly, with include path,
20# library and dependencies set up. If you are using a static build, you are
21# responsible for adding any external dependencies (such as zlib, bzlib...).
22#
23# <component> can be one of:
24# avcodec
25# avdevice
26# avfilter
27# avformat
28# avutil
29# postproc
30# swresample
31# swscale
19# 32#
20 33
21include(FindPackageHandleStandardArgs) 34set(_FFmpeg_ALL_COMPONENTS
22 35 avcodec
23find_package_handle_standard_args(FFMPEG 36 avdevice
24 FOUND_VAR FFMPEG_FOUND 37 avfilter
25 REQUIRED_VARS 38 avformat
26 FFMPEG_LIBRARY 39 avutil
27 FFMPEG_INCLUDE_DIR 40 postproc
28 VERSION_VAR FFMPEG_VERSION 41 swresample
42 swscale
29) 43)
30 44
31if(FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR) 45set(_FFmpeg_DEPS_avcodec avutil)
32 # in cache already 46set(_FFmpeg_DEPS_avdevice avcodec avformat avutil)
33 set(FFMPEG_FOUND TRUE) 47set(_FFmpeg_DEPS_avfilter avutil)
34else() 48set(_FFmpeg_DEPS_avformat avcodec avutil)
35 # use pkg-config to get the directories and then use these values 49set(_FFmpeg_DEPS_postproc avutil)
36 # in the FIND_PATH() and FIND_LIBRARY() calls 50set(_FFmpeg_DEPS_swresample avutil)
37 find_package(PkgConfig) 51set(_FFmpeg_DEPS_swscale avutil)
38 if(PKG_CONFIG_FOUND) 52
39 pkg_check_modules(_FFMPEG_AVCODEC libavcodec) 53function(find_ffmpeg LIBNAME)
40 pkg_check_modules(_FFMPEG_AVUTIL libavutil) 54 if(DEFINED ENV{FFMPEG_DIR})
41 pkg_check_modules(_FFMPEG_SWSCALE libswscale) 55 set(FFMPEG_DIR $ENV{FFMPEG_DIR})
42 endif() 56 endif()
43 57
44 find_path(FFMPEG_AVCODEC_INCLUDE_DIR 58 if(FFMPEG_DIR)
45 NAMES libavcodec/avcodec.h 59 list(APPEND INCLUDE_PATHS
46 PATHS ${_FFMPEG_AVCODEC_INCLUDE_DIRS} 60 ${FFMPEG_DIR}
47 /usr/include 61 ${FFMPEG_DIR}/ffmpeg
48 /usr/local/include 62 ${FFMPEG_DIR}/lib${LIBNAME}
49 /opt/local/include 63 ${FFMPEG_DIR}/include/lib${LIBNAME}
50 /sw/include 64 ${FFMPEG_DIR}/include/ffmpeg
51 PATH_SUFFIXES ffmpeg libav) 65 ${FFMPEG_DIR}/include
52 66 NO_DEFAULT_PATH
53 find_library(FFMPEG_LIBAVCODEC 67 NO_CMAKE_FIND_ROOT_PATH
54 NAMES avcodec 68 )
55 PATHS ${_FFMPEG_AVCODEC_LIBRARY_DIRS} 69 list(APPEND LIB_PATHS
56 /usr/lib 70 ${FFMPEG_DIR}
57 /usr/local/lib 71 ${FFMPEG_DIR}/lib
58 /opt/local/lib 72 ${FFMPEG_DIR}/lib${LIBNAME}
59 /sw/lib) 73 NO_DEFAULT_PATH
74 NO_CMAKE_FIND_ROOT_PATH
75 )
76 else()
77 list(APPEND INCLUDE_PATHS
78 /usr/local/include/ffmpeg
79 /usr/local/include/lib${LIBNAME}
80 /usr/include/ffmpeg
81 /usr/include/lib${LIBNAME}
82 /usr/include/ffmpeg/lib${LIBNAME}
83 )
60 84
61 find_library(FFMPEG_LIBAVUTIL 85 list(APPEND LIB_PATHS
62 NAMES avutil
63 PATHS ${_FFMPEG_AVUTIL_LIBRARY_DIRS}
64 /usr/lib
65 /usr/local/lib 86 /usr/local/lib
66 /opt/local/lib
67 /sw/lib)
68
69 find_library(FFMPEG_LIBSWSCALE
70 NAMES swscale
71 PATHS ${_FFMPEG_SWSCALE_LIBRARY_DIRS}
72 /usr/lib 87 /usr/lib
73 /usr/local/lib 88 )
74 /opt/local/lib
75 /sw/lib)
76
77 if(FFMPEG_LIBAVCODEC AND FFMPEG_LIBAVUTIL AND FFMPEG_LIBSWSCALE)
78 set(FFMPEG_FOUND TRUE)
79 endif() 89 endif()
80 90
81 if(FFMPEG_FOUND) 91 find_path(FFmpeg_INCLUDE_${LIBNAME} lib${LIBNAME}/${LIBNAME}.h
82 set(FFMPEG_INCLUDE_DIR ${FFMPEG_AVCODEC_INCLUDE_DIR}) 92 HINTS ${INCLUDE_PATHS}
83 set(FFMPEG_LIBRARIES 93 )
84 ${FFMPEG_LIBAVCODEC} 94
85 ${FFMPEG_LIBAVUTIL} 95 find_library(FFmpeg_LIBRARY_${LIBNAME} ${LIBNAME}
86 ${FFMPEG_LIBSWSCALE}) 96 HINTS ${LIB_PATHS}
97 )
98
99 if(NOT FFMPEG_DIR AND (NOT FFmpeg_LIBRARY_${LIBNAME} OR NOT FFmpeg_INCLUDE_${LIBNAME}))
100 # Didn't find it in the usual paths, try pkg-config
101 find_package(PkgConfig QUIET)
102 pkg_check_modules(FFmpeg_PKGCONFIG_${LIBNAME} QUIET lib${LIBNAME})
103
104 find_path(FFmpeg_INCLUDE_${LIBNAME} lib${LIBNAME}/${LIBNAME}.h
105 ${FFmpeg_PKGCONFIG_${LIBNAME}_INCLUDE_DIRS}
106 )
107
108 find_library(FFmpeg_LIBRARY_${LIBNAME} ${LIBNAME}
109 ${FFmpeg_PKGCONFIG_${LIBNAME}_LIBRARY_DIRS}
110 )
87 endif() 111 endif()
88 112
89 if(FFMPEG_FOUND) 113 if(FFmpeg_INCLUDE_${LIBNAME} AND FFmpeg_LIBRARY_${LIBNAME})
90 if(NOT FFMPEG_FIND_QUIETLY) 114 set(FFmpeg_INCLUDE_${LIBNAME} "${FFmpeg_INCLUDE_${LIBNAME}}" PARENT_SCOPE)
91 message(STATUS 115 set(FFmpeg_LIBRARY_${LIBNAME} "${FFmpeg_LIBRARY_${LIBNAME}}" PARENT_SCOPE)
92 "Found FFMPEG or Libav: ${FFMPEG_LIBRARIES}, ${FFMPEG_INCLUDE_DIR}") 116
117 # Extract FFmpeg version from version.h
118 foreach(v MAJOR MINOR MICRO)
119 set(FFmpeg_${LIBNAME}_VERSION_${v} 0)
120 endforeach()
121 string(TOUPPER ${LIBNAME} LIBNAME_UPPER)
122 file(STRINGS "${FFmpeg_INCLUDE_${LIBNAME}}/lib${LIBNAME}/version.h" _FFmpeg_VERSION_H_CONTENTS REGEX "#define LIB${LIBNAME_UPPER}_VERSION_(MAJOR|MINOR|MICRO) ")
123 set(_FFmpeg_VERSION_REGEX "([0-9]+)")
124 foreach(v MAJOR MINOR MICRO)
125 if("${_FFmpeg_VERSION_H_CONTENTS}" MATCHES "#define LIB${LIBNAME_UPPER}_VERSION_${v}[\\t ]+${_FFmpeg_VERSION_REGEX}")
126 set(FFmpeg_${LIBNAME}_VERSION_${v} "${CMAKE_MATCH_1}")
127 endif()
128 endforeach()
129 set(FFmpeg_${LIBNAME}_VERSION "${FFmpeg_${LIBNAME}_VERSION_MAJOR}.${FFmpeg_${LIBNAME}_VERSION_MINOR}.${FFmpeg_${LIBNAME}_VERSION_MICRO}")
130 set(FFmpeg_${c}_VERSION "${FFmpeg_${LIBNAME}_VERSION}" PARENT_SCOPE)
131 unset(_FFmpeg_VERSION_REGEX)
132 unset(_FFmpeg_VERSION_H_CONTENTS)
133
134 set(FFmpeg_${c}_FOUND TRUE PARENT_SCOPE)
135 if(NOT FFmpeg_FIND_QUIETLY)
136 message("-- Found ${LIBNAME}: ${FFmpeg_INCLUDE_${LIBNAME}} ${FFmpeg_LIBRARY_${LIBNAME}} (version: ${FFmpeg_${LIBNAME}_VERSION})")
93 endif() 137 endif()
94 else() 138 endif()
95 if(FFMPEG_FIND_REQUIRED) 139endfunction()
96 message(FATAL_ERROR 140
97 "Could not find libavcodec or libavutil or libswscale") 141foreach(c ${_FFmpeg_ALL_COMPONENTS})
142 find_ffmpeg(${c})
143endforeach()
144
145foreach(c ${_FFmpeg_ALL_COMPONENTS})
146 if(FFmpeg_${c}_FOUND)
147 list(APPEND FFmpeg_INCLUDE_DIR ${FFmpeg_INCLUDE_${c}})
148 list(APPEND FFmpeg_LIBRARIES ${FFmpeg_LIBRARY_${c}})
149
150 add_library(FFmpeg::${c} IMPORTED UNKNOWN)
151 set_target_properties(FFmpeg::${c} PROPERTIES
152 IMPORTED_LOCATION ${FFmpeg_LIBRARY_${c}}
153 INTERFACE_INCLUDE_DIRECTORIES ${FFmpeg_INCLUDE_${c}}
154 )
155 if(_FFmpeg_DEPS_${c})
156 set(deps)
157 foreach(dep ${_FFmpeg_DEPS_${c}})
158 list(APPEND deps FFmpeg::${dep})
159 endforeach()
160
161 set_target_properties(FFmpeg::${c} PROPERTIES
162 INTERFACE_LINK_LIBRARIES "${deps}"
163 )
164 unset(deps)
98 endif() 165 endif()
99 endif() 166 endif()
167endforeach()
168
169if(FFmpeg_INCLUDE_DIR)
170 list(REMOVE_DUPLICATES FFmpeg_INCLUDE_DIR)
100endif() 171endif()
172
173foreach(c ${FFmpeg_FIND_COMPONENTS})
174 list(APPEND _FFmpeg_REQUIRED_VARS FFmpeg_INCLUDE_${c} FFmpeg_LIBRARY_${c})
175endforeach()
176
177include(FindPackageHandleStandardArgs)
178find_package_handle_standard_args(FFmpeg
179 REQUIRED_VARS ${_FFmpeg_REQUIRED_VARS}
180 HANDLE_COMPONENTS
181)
182
183foreach(c ${_FFmpeg_ALL_COMPONENTS})
184 unset(_FFmpeg_DEPS_${c})
185endforeach()
186unset(_FFmpeg_ALL_COMPONENTS)
187unset(_FFmpeg_REQUIRED_VARS)
diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt
index 2cf95937e..dd4c29ed3 100644
--- a/src/video_core/CMakeLists.txt
+++ b/src/video_core/CMakeLists.txt
@@ -271,14 +271,13 @@ create_target_directory_groups(video_core)
271target_link_libraries(video_core PUBLIC common core) 271target_link_libraries(video_core PUBLIC common core)
272target_link_libraries(video_core PRIVATE glad xbyak) 272target_link_libraries(video_core PRIVATE glad xbyak)
273 273
274if (MSVC) 274if (YUZU_USE_BUNDLED_FFMPEG AND NOT WIN32)
275 target_include_directories(video_core PRIVATE ${FFMPEG_INCLUDE_DIR}) 275 add_dependencies(video_core ffmpeg-build)
276 target_link_libraries(video_core PUBLIC ${FFMPEG_LIBRARY_DIR}/swscale.lib ${FFMPEG_LIBRARY_DIR}/avcodec.lib ${FFMPEG_LIBRARY_DIR}/avutil.lib)
277else()
278 target_include_directories(video_core PRIVATE ${FFMPEG_INCLUDE_DIR})
279 target_link_libraries(video_core PRIVATE ${FFMPEG_LIBRARIES})
280endif() 276endif()
281 277
278target_include_directories(video_core PRIVATE ${FFmpeg_INCLUDE_DIR})
279target_link_libraries(video_core PRIVATE ${FFmpeg_LIBRARIES})
280
282add_dependencies(video_core host_shaders) 281add_dependencies(video_core host_shaders)
283target_include_directories(video_core PRIVATE ${HOST_SHADERS_INCLUDE}) 282target_include_directories(video_core PRIVATE ${HOST_SHADERS_INCLUDE})
284target_include_directories(video_core PRIVATE sirit ../../externals/Vulkan-Headers/include) 283target_include_directories(video_core PRIVATE sirit ../../externals/Vulkan-Headers/include)