From a2495c5ef192e86f4dc5204e4e250f3b6cc56ef4 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Mon, 17 Jan 2022 19:04:18 +0100 Subject: [PATCH] Use symlink to simplify Windows ffmpeg dependency The FFmpeg dependency is downloaded from two separate zipfiles. Symlink include/ to expose everything from a single directory, to simplify the meson script. PR #2952 --- app/meson.build | 7 +++---- cross_win32.txt | 3 +-- cross_win64.txt | 3 +-- prebuilt-deps/Makefile | 2 ++ 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/meson.build b/app/meson.build index cee261bb..39334a3d 100644 --- a/app/meson.build +++ b/app/meson.build @@ -118,10 +118,9 @@ else include_directories: include_directories(sdl2_include_dir) ) - prebuilt_ffmpeg_shared = meson.get_cross_property('prebuilt_ffmpeg_shared') - prebuilt_ffmpeg_dev = meson.get_cross_property('prebuilt_ffmpeg_dev') - ffmpeg_bin_dir = meson.current_source_dir() + '/../prebuilt-deps/' + prebuilt_ffmpeg_shared + '/bin' - ffmpeg_include_dir = '../prebuilt-deps/' + prebuilt_ffmpeg_dev + '/include' + prebuilt_ffmpeg = meson.get_cross_property('prebuilt_ffmpeg') + ffmpeg_bin_dir = meson.current_source_dir() + '/../prebuilt-deps/' + prebuilt_ffmpeg + '/bin' + ffmpeg_include_dir = '../prebuilt-deps/' + prebuilt_ffmpeg + '/include' ffmpeg = declare_dependency( dependencies: [ cc.find_library('avcodec-58', dirs: ffmpeg_bin_dir), diff --git a/cross_win32.txt b/cross_win32.txt index b0e43622..045cb5c6 100644 --- a/cross_win32.txt +++ b/cross_win32.txt @@ -16,6 +16,5 @@ cpu = 'i686' endian = 'little' [properties] -prebuilt_ffmpeg_shared = 'ffmpeg-4.3.1-win32-shared' -prebuilt_ffmpeg_dev = 'ffmpeg-4.3.1-win32-dev' +prebuilt_ffmpeg = 'ffmpeg-4.3.1-win32-shared' prebuilt_sdl2 = 'SDL2-2.0.18/i686-w64-mingw32' diff --git a/cross_win64.txt b/cross_win64.txt index 6625c0cf..d48c137a 100644 --- a/cross_win64.txt +++ b/cross_win64.txt @@ -16,6 +16,5 @@ cpu = 'x86_64' endian = 'little' [properties] -prebuilt_ffmpeg_shared = 'ffmpeg-4.3.1-win64-shared' -prebuilt_ffmpeg_dev = 'ffmpeg-4.3.1-win64-dev' +prebuilt_ffmpeg = 'ffmpeg-4.3.1-win64-shared' prebuilt_sdl2 = 'SDL2-2.0.18/x86_64-w64-mingw32' diff --git a/prebuilt-deps/Makefile b/prebuilt-deps/Makefile index fe6d8217..41b7cf2a 100644 --- a/prebuilt-deps/Makefile +++ b/prebuilt-deps/Makefile @@ -14,6 +14,7 @@ prepare-ffmpeg-win32: @./prepare-dep https://github.com/Genymobile/scrcpy/releases/download/v1.16/ffmpeg-4.3.1-win32-dev.zip \ 230efb08e9bcf225bd474da29676c70e591fc94d8790a740ca801408fddcb78b \ ffmpeg-4.3.1-win32-dev + ln -sf ../ffmpeg-4.3.1-win32-dev/include ffmpeg-4.3.1-win32-shared/ prepare-ffmpeg-win64: @./prepare-dep https://github.com/Genymobile/scrcpy/releases/download/v1.16/ffmpeg-4.3.1-win64-shared.zip \ @@ -22,6 +23,7 @@ prepare-ffmpeg-win64: @./prepare-dep https://github.com/Genymobile/scrcpy/releases/download/v1.16/ffmpeg-4.3.1-win64-dev.zip \ 2e8038242cf8e1bd095c2978f196ff0462b122cc6ef7e74626a6af15459d8b81 \ ffmpeg-4.3.1-win64-dev + ln -sf ../ffmpeg-4.3.1-win64-dev/include ffmpeg-4.3.1-win64-shared/ prepare-sdl2: @./prepare-dep https://libsdl.org/release/SDL2-devel-2.0.18-mingw.tar.gz \