From dc9acc4d140ebc5f431235b26bb8b7bfc1414316 Mon Sep 17 00:00:00 2001 From: ttr-007 Date: Sat, 26 Sep 2026 13:09:39 +0530 Subject: [PATCH] fix(cmake): link missing static deps for GStreamer opengl plugin The statically-linked gstopengl plugin has no pkg-config file, so FindGStreamer.cmake falls back to a bare find_library() call that only adds the plugin archive itself, with no transitive dependencies. Internally gstopengl links against graphene, libpng, libjpeg, and gstreamer-controller-1.0, none of which were being linked in, causing undefined-symbol link errors whenever the opengl plugin is enabled (e.g. QGC_ENABLE_HERELINK=ON on Android, which is currently the only way to build against Qt 6.6.3 / minSdk 25 for Android 7.1-8.x support). Reproduced building QGroundControl for Android arm64-v8a on Stable_V5.0 with Qt 6.6.3; the four symbols surfaced one at a time as each was fixed and relinked. Co-Authored-By: Claude Sonnet 5 --- cmake/find-modules/FindGStreamer.cmake | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/cmake/find-modules/FindGStreamer.cmake b/cmake/find-modules/FindGStreamer.cmake index d7bf04d042b2..6f0f04b2e329 100644 --- a/cmake/find-modules/FindGStreamer.cmake +++ b/cmake/find-modules/FindGStreamer.cmake @@ -443,6 +443,25 @@ if(GStreamer_FOUND AND NOT TARGET GStreamer::GStreamer) endif() endforeach() + if("opengl" IN_LIST GSTREAMER_PLUGINS) + find_library(GRAPHENE_LIBRARY NAMES graphene-1.0 PATHS ${GSTREAMER_LIB_PATH}) + find_library(PNG_LIBRARY NAMES png16 png PATHS ${GSTREAMER_LIB_PATH}) + find_library(JPEG_LIBRARY NAMES jpeg PATHS ${GSTREAMER_LIB_PATH}) + find_library(GST_CONTROLLER_LIBRARY NAMES gstcontroller-1.0 PATHS ${GSTREAMER_LIB_PATH}) + if(GRAPHENE_LIBRARY) + target_link_libraries(GStreamer::Plugins INTERFACE ${GRAPHENE_LIBRARY}) + endif() + if(PNG_LIBRARY) + target_link_libraries(GStreamer::Plugins INTERFACE ${PNG_LIBRARY}) + endif() + if(JPEG_LIBRARY) + target_link_libraries(GStreamer::Plugins INTERFACE ${JPEG_LIBRARY}) + endif() + if(GST_CONTROLLER_LIBRARY) + target_link_libraries(GStreamer::Plugins INTERFACE ${GST_CONTROLLER_LIBRARY}) + endif() + endif() + target_link_libraries(GStreamer::GStreamer INTERFACE GStreamer::Plugins) endif() endif()