aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2022-01-21 21:55:08 +0100
committerJoerg Bornemann <joerg.bornemann@qt.io>2022-01-31 11:10:40 +0100
commit8a94d1e2946644253cf2979c35636cbfb850422d (patch)
tree7e67e855ee3408d28a63585645e1069c4fbb4513 /CMakeLists.txt
parent4a5550cc035b6f2e4e7e14369620c1787bbe1521 (diff)
CMake: Rework inter-repository dependency resolution
In certain cases the dependency resolution between Qt repositories resulted in a wrong order, for example qtsvg being handled before qtbase. See the linked task for an example. Replace the existing algorithm with a post-order traversal of the dependency graph to produce a topological ordering. Rename qt_internal_add_module_dependencies to qt_internal_resolve_module_dependencies and remove unnecessary positional arguments. Use keyword arguments for a nicer API. Raise the cmake_policy in QtSynchronizeRepo.cmake to avoid policy warnings we now would get due to the use of IN_LIST. Fixes: QTBUG-98268 Change-Id: I1425fd9c802fa71ae42549ceb14bcfc4c0a62078 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 3 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ed25c225..e7ebd25b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,16 +49,15 @@ if(NOT QT_BUILD_SUBMODULES)
endif()
set(QT_BUILD_SUBMODULES "${QT_BUILD_SUBMODULES}" CACHE STRING "Submodules to build")
-set(qt_module_dependency_map_prefix "__qt_module_dependencies_")
-qt_internal_sort_module_dependencies("${QT_BUILD_SUBMODULES}" QT_BUILD_SUBMODULES
- "${qt_module_dependency_map_prefix}")
+qt_internal_sort_module_dependencies("${QT_BUILD_SUBMODULES}" QT_BUILD_SUBMODULES)
foreach(module IN LISTS QT_BUILD_SUBMODULES)
# Check for unmet dependencies
if(NOT DEFINED BUILD_${module} OR BUILD_${module})
message(NOTICE "Checking dependencies of '${module}'")
get_property(required_deps GLOBAL PROPERTY QT_REQUIRED_DEPS_FOR_${module})
- foreach(dep IN LISTS "${qt_module_dependency_map_prefix}${module}")
+ get_property(dependencies GLOBAL PROPERTY QT_DEPS_FOR_${module})
+ foreach(dep IN LISTS dependencies)
if (dep STREQUAL "qtbase")
# Always available skip
continue()