Do not expose Qt internals by the HEADER_MODULEs

HEADER_MODULEs use the INTERFACE visibility to link libraries. This
causes a transitional propagating of the Qt-internal compile definitions
and options to the user targets.

This commit avoids an implicit adding of the Qt::PlatformModuleInternal
library to the HEADER_MODULEs and stops propagation of the Qt-internal
compile definitions and options. If module wants the transitional
propagation of some properties, this needs to be done explicitly.

Amends 8b7894cb63

Pick-to: 6.1
Fixes: QTBUG-89951
Change-Id: Ia9cecc38bac98eb5bc6e47d288308b49813ab5ac
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Alexey Edelev 2021-05-20 14:08:20 +02:00
parent 40878e7517
commit 5b64e5950c

View File

@ -440,6 +440,7 @@ function(qt_internal_add_module target)
QT_BUILD_${module_define_infix}_LIB ### FIXME: use QT_BUILD_ADDON for Add-ons or remove if we don't have add-ons anymore
${deprecation_define}
)
list(APPEND arg_LIBRARIES Qt::PlatformModuleInternal)
endif()
qt_internal_extend_target("${target}"
@ -455,7 +456,7 @@ function(qt_internal_add_module target)
${arg_DEFINES}
${defines_for_extend_target}
PUBLIC_LIBRARIES ${arg_PUBLIC_LIBRARIES}
LIBRARIES ${arg_LIBRARIES} Qt::PlatformModuleInternal
LIBRARIES ${arg_LIBRARIES}
PRIVATE_MODULE_INTERFACE ${arg_PRIVATE_MODULE_INTERFACE}
FEATURE_DEPENDENCIES ${arg_FEATURE_DEPENDENCIES}
DBUS_ADAPTOR_SOURCES ${arg_DBUS_ADAPTOR_SOURCES}