qt5base-lts/tests/auto
Alexandru Croitor 6fcc272ac9 CMake: Introduce finalizer mode handling of static plugins
Allow linking all plugin initializer object libraries directly
into the final target (executable or shared library).

The finalizer mode is triggered when the project adds a call
to qt_import_plugins, as well when the project has an explicit
call to qt_finalize_executable or when it is defer called by
CMake 3.19+.

Otherwise the old non-finalizer mode is used, where each plugin
initializer object library is propagated via the usage
requirements of its associated module.

A user can explicitly opt in or out of the new mode by calling
qt_enable_import_plugins_finalizer_mode(target TRUE/FALSE)

The implementation, at configure time, recursively collects all
dependencies of the target to extract a list of used Qt modules.

From each module we extract its list of associated plugins and
their genex conditions. These genexes are used to conditionally
link the plugins and the initializers.

Renamed QT_PLUGINS property to _qt_plugins, so we can safely query the
property even on INTERFACE libraries with lower CMake versions.
QT_PLUGINS is kept for backwards compatibility with projects already
using it, but should be removed in Qt 7.

The upside of the finalizer mode is that it avoids creating link
cycles (e.g. Gui -> SvgPlugin -> Gui case) which causes CMake to
duplicate the library on the link line, slowing down link time as well
as possibly breaking link order dependencies.

The downside is that finalizer mode can't cope with generator
expressions at the moment. So if a Qt module target is wrapped in a
generator expression, it's plugins will not be detected and thus
linked.

Task-number: QTBUG-80863
Task-number: QTBUG-92933
Change-Id: Ic40c8ae5807a154ed18fcac18b25f00864c8f143
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-05-20 00:55:46 +02:00
..
bic/data Add binary compatibility files for Qt 6.0.0 2021-04-08 06:34:13 +00:00
cmake CMake: Introduce finalizer mode handling of static plugins 2021-05-20 00:55:46 +02:00
concurrent Fix gcc warnings from having only one of assignment/copy 2021-04-11 19:53:51 +02:00
corelib Fix QUrl::fromLocalFile with long path prefix 2021-05-19 21:38:38 +02:00
dbus Port QDBusServiceWatcher::watchedServices to bindable properties 2021-04-28 16:59:53 +02:00
gui rhi: gl: Add support for importing an existing renderbuffer object 2021-05-19 17:35:35 +02:00
guiapplauncher Move QStateMachine from QtCore to QtScxml 2020-08-24 20:10:25 +02:00
network Fix BASE argument of qt_add_resources 2021-05-18 16:02:52 +02:00
opengl Remove the qmake project files 2021-01-07 15:32:28 +01:00
other Add tests for QAndroidApplication's sdkVersion and activity 2021-05-13 01:41:36 +03:00
printsupport Remove the qmake project files 2021-01-07 15:32:28 +01:00
shared Remove false Q_UNREACHABLE from shaping code 2021-02-03 09:44:44 +01:00
sql QSqlTableModel::orderByClause(): Quote the table name 2021-05-03 14:10:36 +00:00
testlib Fix compiler warnings from int/size_t mismatches 2021-04-28 06:48:43 +02:00
tools Fix BASE argument of qt_add_resources 2021-05-18 16:02:52 +02:00
widgets Blacklist tst_QWidget::multipleToplevelFocusCheck() on SLES 15 2021-05-18 11:56:06 +02:00
xml tst_qdom: clean-up the code enabled only before Qt 6 2021-01-15 15:22:08 +01:00
CMakeLists.txt CMake: Build minimal subset of tests in desktop static builds 2021-04-06 09:15:37 +01:00
network-settings.h Replace QtTest headers with QTest 2020-12-22 15:20:30 +01:00