From 85b941f4251bb5207db65efc9ccdd1f5586c8d11 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Thu, 8 Dec 2022 20:13:58 +0100 Subject: [PATCH] Remove CMake version check when adding _lib_pri to ALL It looks like adding dependencies to interface libraries is either not fixed or broken in CMake versions newer than 3.20. Remove the CMake version check to ensure that 'lib_pri' targets are executed. This will restore the initial behavior. Amends cfcc4ef8edc4e8256ae738bbe8c23b4204021830 Pick-to: 6.2 6.4 Fixes: QTBUG-109240 Fixes: QTBUG-109239 Change-Id: I8c5b317fcdd0a715a1a668b4e955df1acfe4be8b Reviewed-by: Alexandru Croitor --- cmake/QtPriHelpers.cmake | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cmake/QtPriHelpers.cmake b/cmake/QtPriHelpers.cmake index 8a76b6dbb1..2b3128ef6c 100644 --- a/cmake/QtPriHelpers.cmake +++ b/cmake/QtPriHelpers.cmake @@ -541,11 +541,10 @@ QT.${config_module_name}_private.disabled_features = ${disabled_private_features "-DIMPLICIT_LINK_DIRECTORIES=${implicit_link_directories}" -P "${QT_CMAKE_DIR}/QtGenerateLibPri.cmake" VERBATIM) - # In CMake versions older than 3.20 add_dependencies have no effect when adding interface - # libraries. So need to add the '_lib_pri' targets to ALL to make sure that the related - # rules executed. + # add_dependencies has no effect when adding interface libraries. So need to add the + # '_lib_pri' targets to ALL to make sure that the related rules executed. unset(add_pri_target_to_all) - if(CMAKE_VERSION VERSION_LESS 3.20 AND is_interface_lib) + if(is_interface_lib) set(add_pri_target_to_all ALL) endif() add_custom_target(${target}_lib_pri ${add_pri_target_to_all}