mirror of https://github.com/qt/qt5.git
Avoid collecting dependencies from modules that were explicitly skipped
If either -skip <module> or BUILD_<module>=OFF is set from command line
we should avoid processing the module dependencies and exclude it from
the list of modules that needs to be build.
Change-Id: Ieec8db085221cc4abd5d8ac83c06ecce25d5d4b0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 13a7e25f5d
)
This commit is contained in:
parent
ea47cf9278
commit
aec2d4e2e1
|
@ -29,16 +29,26 @@ include(ECMOptionalAddSubdirectory)
|
||||||
|
|
||||||
qt_internal_top_level_before_build_submodules()
|
qt_internal_top_level_before_build_submodules()
|
||||||
|
|
||||||
|
qt_internal_find_modules(known_submodules)
|
||||||
# Get submodule list if not already defined
|
# Get submodule list if not already defined
|
||||||
if(NOT QT_BUILD_SUBMODULES)
|
if(NOT QT_BUILD_SUBMODULES)
|
||||||
if(DEFINED ENV{QT_BUILD_SUBMODULES})
|
if(DEFINED ENV{QT_BUILD_SUBMODULES})
|
||||||
set(QT_BUILD_SUBMODULES "$ENV{QT_BUILD_SUBMODULES}")
|
set(QT_BUILD_SUBMODULES "$ENV{QT_BUILD_SUBMODULES}")
|
||||||
else()
|
else()
|
||||||
qt_internal_find_modules(QT_BUILD_SUBMODULES)
|
set(QT_BUILD_SUBMODULES "${known_submodules}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
set(QT_BUILD_SUBMODULES "${QT_BUILD_SUBMODULES}" CACHE STRING "Submodules to build")
|
set(QT_BUILD_SUBMODULES "${QT_BUILD_SUBMODULES}" CACHE STRING "Submodules to build")
|
||||||
|
|
||||||
|
# Preliminary check if module should be skipped since -skip <module> or BUILD_<module>
|
||||||
|
# are provided.
|
||||||
|
set(explicitly_skipped_modules "")
|
||||||
|
foreach(module IN LISTS known_submodules)
|
||||||
|
if(DEFINED BUILD_${module} AND NOT BUILD_${module})
|
||||||
|
list(APPEND explicitly_skipped_modules ${module})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
foreach(module IN LISTS QT_BUILD_SUBMODULES)
|
foreach(module IN LISTS QT_BUILD_SUBMODULES)
|
||||||
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${module}/CMakeLists.txt)
|
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${module}/CMakeLists.txt)
|
||||||
message(FATAL_ERROR
|
message(FATAL_ERROR
|
||||||
|
@ -48,7 +58,8 @@ foreach(module IN LISTS QT_BUILD_SUBMODULES)
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
qt_internal_sort_module_dependencies("${QT_BUILD_SUBMODULES}" QT_BUILD_SUBMODULES)
|
qt_internal_sort_module_dependencies("${QT_BUILD_SUBMODULES}" QT_BUILD_SUBMODULES
|
||||||
|
SKIP_MODULES ${explicitly_skipped_modules})
|
||||||
|
|
||||||
foreach(module IN LISTS QT_BUILD_SUBMODULES)
|
foreach(module IN LISTS QT_BUILD_SUBMODULES)
|
||||||
# Check for unmet dependencies
|
# Check for unmet dependencies
|
||||||
|
|
|
@ -111,10 +111,12 @@ endfunction()
|
||||||
#
|
#
|
||||||
# NORMALIZE_REPO_NAME_IF_NEEDED Will remove 'tqtc-' from the beginning of submodule dependencies
|
# NORMALIZE_REPO_NAME_IF_NEEDED Will remove 'tqtc-' from the beginning of submodule dependencies
|
||||||
# if a tqtc- named directory does not exist.
|
# if a tqtc- named directory does not exist.
|
||||||
|
#
|
||||||
|
# SKIP_MODULES Modules that should be skipped from evaluation completely.
|
||||||
function(qt_internal_resolve_module_dependencies module out_ordered out_revisions)
|
function(qt_internal_resolve_module_dependencies module out_ordered out_revisions)
|
||||||
set(options IN_RECURSION NORMALIZE_REPO_NAME_IF_NEEDED)
|
set(options IN_RECURSION NORMALIZE_REPO_NAME_IF_NEEDED)
|
||||||
set(oneValueArgs REVISION SKIPPED_VAR)
|
set(oneValueArgs REVISION SKIPPED_VAR)
|
||||||
set(multiValueArgs PARSED_DEPENDENCIES)
|
set(multiValueArgs PARSED_DEPENDENCIES SKIP_MODULES)
|
||||||
cmake_parse_arguments(arg "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
cmake_parse_arguments(arg "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||||
|
|
||||||
# Clear the property that stores the repositories we've already seen.
|
# Clear the property that stores the repositories we've already seen.
|
||||||
|
@ -122,10 +124,10 @@ function(qt_internal_resolve_module_dependencies module out_ordered out_revision
|
||||||
set_property(GLOBAL PROPERTY _qt_internal_seen_repos)
|
set_property(GLOBAL PROPERTY _qt_internal_seen_repos)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Bail out if we've seen the module already.
|
# Bail out if we've seen the module already or it was skipped explicitly from command line.
|
||||||
qt_internal_resolve_module_dependencies_set_skipped(FALSE)
|
qt_internal_resolve_module_dependencies_set_skipped(FALSE)
|
||||||
get_property(seen GLOBAL PROPERTY _qt_internal_seen_repos)
|
get_property(seen GLOBAL PROPERTY _qt_internal_seen_repos)
|
||||||
if(module IN_LIST seen)
|
if(module IN_LIST seen OR module IN_LIST arg_SKIP_MODULES)
|
||||||
qt_internal_resolve_module_dependencies_set_skipped(TRUE)
|
qt_internal_resolve_module_dependencies_set_skipped(TRUE)
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
@ -171,11 +173,17 @@ function(qt_internal_resolve_module_dependencies module out_ordered out_revision
|
||||||
set_property(GLOBAL APPEND PROPERTY QT_REQUIRED_DEPS_FOR_${module} ${dependency})
|
set_property(GLOBAL APPEND PROPERTY QT_REQUIRED_DEPS_FOR_${module} ${dependency})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(extra_options "")
|
||||||
|
if(arg_SKIP_MODULES)
|
||||||
|
list(extra_options APPEND SKIP_MODULES ${arg_SKIP_MODULES})
|
||||||
|
endif()
|
||||||
|
|
||||||
qt_internal_resolve_module_dependencies(${dependency} dep_ordered dep_revisions
|
qt_internal_resolve_module_dependencies(${dependency} dep_ordered dep_revisions
|
||||||
REVISION "${revision}"
|
REVISION "${revision}"
|
||||||
SKIPPED_VAR skipped
|
SKIPPED_VAR skipped
|
||||||
IN_RECURSION
|
IN_RECURSION
|
||||||
${normalize_arg}
|
${normalize_arg}
|
||||||
|
${extra_options}
|
||||||
)
|
)
|
||||||
if(NOT skipped)
|
if(NOT skipped)
|
||||||
list(APPEND ordered ${dep_ordered})
|
list(APPEND ordered ${dep_ordered})
|
||||||
|
@ -198,8 +206,14 @@ endfunction()
|
||||||
# modules is the initial list of repos.
|
# modules is the initial list of repos.
|
||||||
# out_all_ordered is the variable name where the result is stored.
|
# out_all_ordered is the variable name where the result is stored.
|
||||||
#
|
#
|
||||||
|
# SKIP_MODULES Modules that should be skipped from evaluation completely.
|
||||||
|
#
|
||||||
# See qt_internal_resolve_module_dependencies for side effects.
|
# See qt_internal_resolve_module_dependencies for side effects.
|
||||||
function(qt_internal_sort_module_dependencies modules out_all_ordered)
|
function(qt_internal_sort_module_dependencies modules out_all_ordered)
|
||||||
|
set(options "")
|
||||||
|
set(oneValueArgs "")
|
||||||
|
set(multiValueArgs SKIP_MODULES)
|
||||||
|
cmake_parse_arguments(arg "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||||
|
|
||||||
# Create a fake repository "all_selected_repos" that has all repositories from the input as
|
# Create a fake repository "all_selected_repos" that has all repositories from the input as
|
||||||
# required dependency. The format must match what qt_internal_parse_dependencies produces.
|
# required dependency. The format must match what qt_internal_parse_dependencies produces.
|
||||||
|
@ -208,9 +222,15 @@ function(qt_internal_sort_module_dependencies modules out_all_ordered)
|
||||||
list(APPEND all_selected_repos_as_parsed_dependencies "${module}/HEAD/FALSE")
|
list(APPEND all_selected_repos_as_parsed_dependencies "${module}/HEAD/FALSE")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
set(extra_args "")
|
||||||
|
if(arg_SKIP_MODULES)
|
||||||
|
set(extra_args SKIP_MODULES ${arg_SKIP_MODULES})
|
||||||
|
endif()
|
||||||
|
|
||||||
qt_internal_resolve_module_dependencies(all_selected_repos ordered unused_revisions
|
qt_internal_resolve_module_dependencies(all_selected_repos ordered unused_revisions
|
||||||
PARSED_DEPENDENCIES ${all_selected_repos_as_parsed_dependencies}
|
PARSED_DEPENDENCIES ${all_selected_repos_as_parsed_dependencies}
|
||||||
NORMALIZE_REPO_NAME_IF_NEEDED
|
NORMALIZE_REPO_NAME_IF_NEEDED
|
||||||
|
${extra_args}
|
||||||
)
|
)
|
||||||
|
|
||||||
# Drop "all_selected_repos" from the output. It depends on all selected repos, thus it must be
|
# Drop "all_selected_repos" from the output. It depends on all selected repos, thus it must be
|
||||||
|
|
Loading…
Reference in New Issue