diff --git a/cmake/QtPublicPluginHelpers.cmake b/cmake/QtPublicPluginHelpers.cmake index 889e764d40..39143cecc3 100644 --- a/cmake/QtPublicPluginHelpers.cmake +++ b/cmake/QtPublicPluginHelpers.cmake @@ -90,10 +90,17 @@ function(__qt_internal_get_static_plugin_condition_genex ">" ) + # No point in linking the plugin initialization source file into static libraries. The + # initialization symbol will be discarded by the linker when the static lib is linked into an + # executable or shared library, because nothing is referencing the global static symbol. + set(type_genex "$") + set(no_static_genex "$>") + # Complete condition that defines whether a static plugin is linked string(CONCAT _plugin_condition "$