From 983d73680a9e6a29adcdcaeb7238efd25dcd52e2 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 8 Jul 2024 19:22:40 +0200 Subject: [PATCH] Make FindFFMPEG understand that pc files can have no Libs.private section --- .github/workflows/windows.yml | 4 ++++ vcpkg/ports/qtmultimedia/portfile.cmake | 1 + vcpkg/ports/qtmultimedia/private_libs.patch | 19 +++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 vcpkg/ports/qtmultimedia/private_libs.patch diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index bb7010a2da..9a93cee761 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -100,6 +100,10 @@ jobs: path: | C:/src/**/*.log + - name: Fix openh264 linking + run: | + sed -i 's/ openh264\.lib //g' /c/builddir/build.ninja + - name: 🌋 Build run: | cmake --build "${{ env.CMAKE_BUILD_DIR }}" --config ${{ env.BUILD_TYPE }} diff --git a/vcpkg/ports/qtmultimedia/portfile.cmake b/vcpkg/ports/qtmultimedia/portfile.cmake index 59c6a0eb81..b160fd6c73 100644 --- a/vcpkg/ports/qtmultimedia/portfile.cmake +++ b/vcpkg/ports/qtmultimedia/portfile.cmake @@ -5,6 +5,7 @@ set(${PORT}_PATCHES static_find_modules.patch fix_avfoundation_target.patch remove-static-ssl-stub.patch + private_libs.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS diff --git a/vcpkg/ports/qtmultimedia/private_libs.patch b/vcpkg/ports/qtmultimedia/private_libs.patch new file mode 100644 index 0000000000..3ffc253f4c --- /dev/null +++ b/vcpkg/ports/qtmultimedia/private_libs.patch @@ -0,0 +1,19 @@ +diff --git a/cmake/FindFFmpeg.cmake b/cmake/FindFFmpeg.cmake +index 6316dde..54f807b 100644 +--- a/cmake/FindFFmpeg.cmake ++++ b/cmake/FindFFmpeg.cmake +@@ -264,9 +264,11 @@ function(__ffmpeg_internal_set_dependencies _component) + string(REGEX MATCHALL "${prefix_l}[^ ]+" libs_dependency ${out}) + string(REGEX MATCHALL "[^ ]+${suffix_lib}" libs_dependency_lib ${out}) + +- string(REGEX REPLACE ".*Libs.private:([^\n\r]+).*" "\\1" out "${pcfile}") +- string(REGEX MATCHALL "${prefix_l}[^ ]+" libs_private_dependency ${out}) +- string(REGEX MATCHALL "[^ ]+${suffix_lib}" libs_private_dependency_lib ${out}) ++ if(out MATCHES "Libs.private:") ++ string(REGEX REPLACE ".*Libs.private:([^\n\r]+).*" "\\1" out "${pcfile}") ++ string(REGEX MATCHALL "${prefix_l}[^ ]+" libs_private_dependency ${out}) ++ string(REGEX MATCHALL "[^ ]+${suffix_lib}" libs_private_dependency_lib ${out}) ++ endif() + + list(APPEND deps_no_suffix ${libs_dependency} ${libs_private_dependency}) + foreach(dependency ${deps_no_suffix})