Uncovered while working on https://codereview.qt-project.org/c/qt/qtquick3d/+/282389/31
Sample failure log:
Order of static libraries matters when using the GNU ld linker on linux, and because something fishy is going on with how we make Gui plugins depend on Gui, and Gui depend on Gui plugins, the linker static lib order gets messed up somehow, and thus causes undefined symbol errors at link time.
Can be reproduced with an app that depends on Qt::Gui and Qt::OpenGL in a more simplified manner (small project will be attached shortly)
Upstream CMake issue at https://gitlab.kitware.com/cmake/cmake/-/issues/20604 the minimal project can also be found there.
The minimal project involving qt looks like this:
It appears that this is expected behavior, and that it's the project responsibility to fix it with LINK_INTERFACE_MULTIPLICITY.
But because what we're doing is wrong in the first place (why have target dependency cycles, if there is no cycle in the underlying .cpp code), that's not really the proper fix.
|For Gerrit Dashboard: QTBUG-83498|
|298067,7||Update dependencies||dev||qt/qttools||Status: MERGED||+2||0|
|298271,5||CMake: Fix failing linux static build||dev||qt/qtquick3d||Status: MERGED||+2||0|
|303989,4||CMake: Implement workaround for failing linux static builds||dev||qt/qtbase||Status: MERGED||+2||0|
|303991,2||CMake: Fix failing linux static build||dev||qt/qtdeclarative||Status: MERGED||+2||0|
|303995,3||Revert "CMake: Fix failing linux static build"||dev||qt/qtdeclarative||Status: MERGED||+2||0|