Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
5.14.0, 6.0.3
Description
with 5.14 statically linked plugins pull in Import.cpp files into every downstream target. these downstream targets can be static intermediate libraries or final targets (executables or loadable modules)
in my use case i'm having dozens of intermediate targets, each will compile their own copy of the Import.cpp files, which slows down the build process quite a bit.
one could avoid excessive compilation by using object libraries in a pattern like this:
add_library(FooPluginImporter OBJECT FooPlugin_Import.cpp) add_library(FooPlugin [...]) target_sources(FooPlugin INTERFACE $<TARGET_OBJECTS:FooPluginImporter>)
this will cause the Import.cpp file to be compiled only once, but the object file will be linked into every target downstream of FooPlugin
Attachments
Issue Links
- relates to
-
QTBUG-93257 qt6_import_qml_plugins does not compose
- Closed
-
QTBUG-92933 Rework automatic static plugin linkage
- Closed
-
QTBUG-97816 Prevent linker from discarding unused shared libraries
- Reported
-
QTBUG-91448 Undefined resource symbols when linking app with a static Qt without qmake and CMake
- Closed
-
QTBUG-110243 Resources are lost when linking static libraries using CMake build system in a separate project
- Closed