diff options
| author | 2022-01-22 12:56:25 +0300 | |
|---|---|---|
| committer | 2022-01-22 12:56:25 +0300 | |
| commit | f68be361591684c403a9ecfcef0c8b3023ca67b4 (patch) | |
| tree | 2759d67fefa5589cd8576b5bf99cb87611571736 | |
| parent | Merge pull request #7735 from german77/udp_battery (diff) | |
| download | yuzu-f68be361591684c403a9ecfcef0c8b3023ca67b4.tar.gz yuzu-f68be361591684c403a9ecfcef0c8b3023ca67b4.tar.xz yuzu-f68be361591684c403a9ecfcef0c8b3023ca67b4.zip | |
Improve FFmpeg cmake file
* Fix compilation if CUDA_INCLUDE_DIRS is empty/contains multiple paths
* Pass CMAKE_{C,CXX}_COMPILER_LAUNCHER to ffmpeg compiler
Diffstat (limited to '')
| -rw-r--r-- | externals/ffmpeg/CMakeLists.txt | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/externals/ffmpeg/CMakeLists.txt b/externals/ffmpeg/CMakeLists.txt index c57b54f77..be8325b47 100644 --- a/externals/ffmpeg/CMakeLists.txt +++ b/externals/ffmpeg/CMakeLists.txt | |||
| @@ -95,7 +95,8 @@ if (NOT WIN32) | |||
| 95 | # ffnvenc could load CUDA libraries at the runtime using dlopen/dlsym or LoadLibrary/GetProcAddress | 95 | # ffnvenc could load CUDA libraries at the runtime using dlopen/dlsym or LoadLibrary/GetProcAddress |
| 96 | # here we handle the hard-linking senario where CUDA is linked during compilation | 96 | # here we handle the hard-linking senario where CUDA is linked during compilation |
| 97 | if (CUDA_FOUND) | 97 | if (CUDA_FOUND) |
| 98 | list(APPEND FFmpeg_HWACCEL_FLAGS --extra-cflags=-I${CUDA_INCLUDE_DIRS}) | 98 | # This line causes build error if CUDA_INCLUDE_DIRS is anything but a single non-empty value |
| 99 | #list(APPEND FFmpeg_HWACCEL_FLAGS --extra-cflags=-I${CUDA_INCLUDE_DIRS}) | ||
| 99 | list(APPEND FFmpeg_HWACCEL_LIBRARIES ${CUDA_LIBRARIES}) | 100 | list(APPEND FFmpeg_HWACCEL_LIBRARIES ${CUDA_LIBRARIES}) |
| 100 | list(APPEND FFmpeg_HWACCEL_INCLUDE_DIRS ${CUDA_INCLUDE_DIRS}) | 101 | list(APPEND FFmpeg_HWACCEL_INCLUDE_DIRS ${CUDA_INCLUDE_DIRS}) |
| 101 | list(APPEND FFmpeg_HWACCEL_LDFLAGS ${CUDA_LDFLAGS}) | 102 | list(APPEND FFmpeg_HWACCEL_LDFLAGS ${CUDA_LDFLAGS}) |
| @@ -119,6 +120,8 @@ if (NOT WIN32) | |||
| 119 | 120 | ||
| 120 | # `configure` parameters builds only exactly what yuzu needs from FFmpeg | 121 | # `configure` parameters builds only exactly what yuzu needs from FFmpeg |
| 121 | # `--disable-vdpau` is needed to avoid linking issues | 122 | # `--disable-vdpau` is needed to avoid linking issues |
| 123 | set(FFmpeg_CC ${CMAKE_C_COMPILER_LAUNCHER} ${CMAKE_C_COMPILER}) | ||
| 124 | set(FFmpeg_CXX ${CMAKE_CXX_COMPILER_LAUNCHER} ${CMAKE_CXX_COMPILER}) | ||
| 122 | add_custom_command( | 125 | add_custom_command( |
| 123 | OUTPUT | 126 | OUTPUT |
| 124 | ${FFmpeg_MAKEFILE} | 127 | ${FFmpeg_MAKEFILE} |
| @@ -137,12 +140,14 @@ if (NOT WIN32) | |||
| 137 | --enable-decoder=h264 | 140 | --enable-decoder=h264 |
| 138 | --enable-decoder=vp8 | 141 | --enable-decoder=vp8 |
| 139 | --enable-decoder=vp9 | 142 | --enable-decoder=vp9 |
| 140 | --cc="${CMAKE_C_COMPILER}" | 143 | --cc="${FFmpeg_CC}" |
| 141 | --cxx="${CMAKE_CXX_COMPILER}" | 144 | --cxx="${FFmpeg_CXX}" |
| 142 | ${FFmpeg_HWACCEL_FLAGS} | 145 | ${FFmpeg_HWACCEL_FLAGS} |
| 143 | WORKING_DIRECTORY | 146 | WORKING_DIRECTORY |
| 144 | ${FFmpeg_BUILD_DIR} | 147 | ${FFmpeg_BUILD_DIR} |
| 145 | ) | 148 | ) |
| 149 | unset(FFmpeg_CC) | ||
| 150 | unset(FFmpeg_CXX) | ||
| 146 | unset(FFmpeg_HWACCEL_FLAGS) | 151 | unset(FFmpeg_HWACCEL_FLAGS) |
| 147 | 152 | ||
| 148 | # Workaround for Ubuntu 18.04's older version of make not being able to call make as a child | 153 | # Workaround for Ubuntu 18.04's older version of make not being able to call make as a child |