qt6-bb10/tests/auto/corelib/io/qresourceengine/staticplugin
Simon Hausmann be9a56e5e3 Make it easier to use resources in plugins when using static linking
RCC generates code that registers resources automatically on program
startup via global constructors. When linking statically and nothing
references the symbols in the .o file compiled from the RCC generated
code, then the linker will discard the embedded resources and they will
not get initialized. That is why for static linking it is necessary to
explicitly initialize resources using the Q_INIT_RESOURCE macro.

We can avoid the need for the explicit initialization in the context of
plugins that are statically linked into the application. resources.prf
can generate a .cpp file with a helper function that contains all the
Q_INIT_RESOURCE calls for all resources in the plugin. That helper
function in turn is injected into the plugin entry point, which in turn
is guaranteed to be included in the final binary.

Change-Id: If1abf9c85ef92935020af073b989c58c1ae6ca63
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-04-23 13:56:07 +00:00
..
.gitignore Make it easier to use resources in plugins when using static linking 2018-04-23 13:56:07 +00:00
main.cpp Make it easier to use resources in plugins when using static linking 2018-04-23 13:56:07 +00:00
staticplugin.json Make it easier to use resources in plugins when using static linking 2018-04-23 13:56:07 +00:00
staticplugin.pro Make it easier to use resources in plugins when using static linking 2018-04-23 13:56:07 +00:00