Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
6.1.0, 6.1.1, 6.1.2, 6.2.0 FF, 6.2.0 Alpha, 6.2.0 Beta1, 6.2.0 Beta2
-
None
-
Conan package manager.
-
-
f7b7262f1 (dev), 2c0e78e7b (6.6), 4b227477f (6.5)
Description
Qt helper function 'qt_generate_qmake_libraries_pri_content' in 'qtbase/cmake/QtPriHelpers.cmake' iterates over targets that Qt links against. For each target it also obtains 'INTERFACE_LINK_LIBRARIES' and adds them to the list of targets to process.
In Conan the 'Vulkan::Vulkan' target 'INTERFACE_LINK_LIBRARIES' property contains 'Vulkan::Vulkan'. This leads to an infinite loop where 'Vulkan::Vulkan' is popped from 'lib_targets' list on line 27 and 'Vulkan::Vulkan' gets prepended back to 'lib_targets' on line 33.
Partially this is a problem with Conan which produces the 'FindVulkan.cmake' file with dubious 'INTERFACE_LINK_LIBRARIES' property value. On the other hand Qt should in my opinion at the very least detect this case and throw an error. This situation can arise on other platforms/dependencies as well and is somewhat difficult to diagnose.
A simple patch for avoiding duplicate targets in 'lib_targets' is attached. Please note that more complicated circular dependencies between multiple targets can still lead to an infinite loop.
For reference: Conan issue #6076
Attachments
For Gerrit Dashboard: QTBUG-95569 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
490389,2 | CMake: Prevent infinite loop when generating module .pri files | dev | qt/qtbase | Status: MERGED | +2 | 0 |
490467,2 | CMake: Prevent infinite loop when generating module .pri files | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |
490468,2 | CMake: Prevent infinite loop when generating module .pri files | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |