diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-04-29 10:46:53 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-04-30 10:13:34 +0200 |
commit | 8ddd3ee60bff1197b251feadf871fdaeb995ef3b (patch) | |
tree | e66c461d2478fb054a74430e78aee1648404daac /cmake | |
parent | 49212cb55a4058f7d8c2f54492e2cf1112e37a09 (diff) | |
download | qtbase-8ddd3ee60bff1197b251feadf871fdaeb995ef3b.tar.gz |
Revert "CMake: qt_find_package() enable debug behavior by default"
It broke configuration of qtwayland standalone tests, due to qtwayland
doing 3 separate qt_find_package(Wayland) calls with the same package
but different arguments in 3 different directory scopes.
The top scope didn't have PROVIDED_TARGETS argument. The rest of the
scopes did have the arguments with either Server or Client, but because
of the debug behavior above being enabled by default the dependencies
weren't registered in the Qt6WaylandClientDependencies.cmake file (and
the server equivalent).
The registration didn't happen due to the skipping logic, when a package
is found and the targets already exist.
This led to standalone tests failing to configure because they tried
linking against non-existent Wayland::Client and Wayland::Server
targets.
This reverts commit dd7e40b1086020f6a054957f4972720cd6849280.
Change-Id: I60e358a4891b84ecec0e127d9de8ab9747a6ab24
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtBuild.cmake | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index fecaf2e831..4968109089 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -4248,14 +4248,9 @@ macro(qt_find_package) # targets to be global. This behavior is not enabled by default, because there are cases # when a regular find_package() (non qt_) can find a package (Freetype -> PNG), and a subsequent # qt_find_package(PNG PROVIDED_TARGET PNG::PNG) still needs to succeed and register the provided - # targets. - # Recently we have observed that some projects, such as QtVirtualKeyboard, will error out in - # static build because of the global promotion error. The previous code only enabled the if - # statement below when QT_DEBUG_QT_FIND_PACKAGE was set to true. Now we have this check enabled - # by default unless QT_FIND_PACKAGE_DISABLE_DEBUG_BEHAVIOR is defined and set to true. + # targets. To enable the debugging behavior, set QT_DEBUG_QT_FIND_PACKAGE to 1. set(_qt_find_package_skip_find_package FALSE) - if((NOT DEFINED QT_FIND_PACKAGE_DISABLE_DEBUG_BEHAVIOR OR NOT QT_FIND_PACKAGE_DISABLE_DEBUG_BEHAVIOR) - AND ${ARGV0}_FOUND AND arg_PROVIDED_TARGETS) + if(QT_DEBUG_QT_FIND_PACKAGE AND ${ARGV0}_FOUND AND arg_PROVIDED_TARGETS) set(_qt_find_package_skip_find_package TRUE) foreach(qt_find_package_target_name ${arg_PROVIDED_TARGETS}) if(NOT TARGET ${qt_find_package_target_name}) |