diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2022-01-21 21:55:08 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2022-04-29 16:22:12 +0200 |
commit | 0ec83c2903a92e91eb566046c1355e57a71eca2b (patch) | |
tree | d903199c15bda2e1ac951b5adb8635f3e86a47d1 /CMakeLists.txt | |
parent | d7133e4de08dcf381970a994af29aa5c2f174d69 (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>
(cherry picked from commit 8a94d1e2946644253cf2979c35636cbfb850422d)
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a0f4d76c..b1afb2f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,16 +52,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() |