CMake: Fix package dependencies of Qt plugins

In a static build of Qt, building a QtGui user project pulled in private
Qt module packages. This happened, because plugins link against private
Qt modules, and we must wrap those link dependencies in
$<BUILD_LOCAL_INTERFACE> / $<BUILD_INTERFACE>.

This amends commit ad7b94e163ac5c3959a7e38d7f48536be288a187.

Task-number: QTBUG-87776
Change-Id: I45f919b7c0cbc9edf40a4818030de984b4afcc0c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Joerg Bornemann 2025-01-28 12:48:42 +01:00
parent e0a44cd32e
commit d39f9a2af7

View File

@ -348,6 +348,7 @@ function(qt_internal_add_plugin target)
list(APPEND qt_register_target_dependencies_args PUBLIC ${arg_PUBLIC_LIBRARIES})
endif()
if(qt_libs_private)
qt_internal_wrap_private_modules(qt_libs_private ${qt_libs_private})
list(APPEND qt_register_target_dependencies_args PRIVATE ${qt_libs_private})
endif()
qt_internal_register_target_dependencies("${target}"