summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2022-12-07 11:23:46 +0100
committerAlexey Edelev <alexey.edelev@qt.io>2022-12-07 15:51:22 +0100
commit4f00d5d0b92bbd5379aaf5f03b6dd8d0c09a24d9 (patch)
tree1445b09bc402f6493c700c5290de10471ff1f61a /cmake
parentcb72901d1cb8c5689000ecc844428789849ea096 (diff)
downloadqtbase-4f00d5d0b92bbd5379aaf5f03b6dd8d0c09a24d9.tar.gz
Add _lib_pri targets to all
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. Amends 190e58e1f4eb9e9bf12a9561cf32cdccdc0b22e0 Fixes: QTBUG-109240 Fixes: QTBUG-109239 Change-Id: I7c565ce3bc15e549569317454c2f7caac823cf66 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit cfcc4ef8edc4e8256ae738bbe8c23b4204021830)
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtPriHelpers.cmake10
1 files changed, 9 insertions, 1 deletions
diff --git a/cmake/QtPriHelpers.cmake b/cmake/QtPriHelpers.cmake
index 75eb209c98..4b34c44fca 100644
--- a/cmake/QtPriHelpers.cmake
+++ b/cmake/QtPriHelpers.cmake
@@ -532,7 +532,15 @@ QT.${config_module_name}_private.disabled_features = ${disabled_private_features
"-DIMPLICIT_LINK_DIRECTORIES=${implicit_link_directories}"
-P "${QT_CMAKE_DIR}/QtGenerateLibPri.cmake"
VERBATIM)
- add_custom_target(${target}_lib_pri DEPENDS "${private_pri_file_path}")
+ # 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.
+ unset(add_pri_target_to_all)
+ if(CMAKE_VERSION VERSION_LESS 3.20 AND arg_HEADER_MODULE)
+ set(add_pri_target_to_all ALL)
+ endif()
+ add_custom_target(${target}_lib_pri ${add_pri_target_to_all}
+ DEPENDS "${private_pri_file_path}")
add_dependencies(${target} ${target}_lib_pri)
endif()