Skip to content

Draft: ECMQmlModule: Overhaul static plugin initialization

Joshua Goins requested to merge work/redstrate/remove-init-function into master

Inspired by https://codereview.qt-project.org/c/qt/qtbase/+/269386 for the new Qt6 plugin CMake functions.

This overhauls how static plugins are linked and initialized, by not compiling the generated resource file and init function until the very end (the application that ends up consuming the static library). The linker might throw away these objects because they aren't used, so this solution yields better results in my testing.

Static plugins are also now automatically registered, instead of deferring the registration to the applications themselves.

Leaving it as a draft, because I want to make some test cases that might show the problem better.

Edited by Joshua Goins

Merge request reports