From d8d1049ff83cf79b8ad7b5518a6758ae9db95f0b Mon Sep 17 00:00:00 2001 From: Mikolaj Boc Date: Wed, 4 Jan 2023 09:54:23 +0100 Subject: [PATCH] Add Qt::Gui to batches unconditionally MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is needed for static plugins to work correctly as currently the only place where plugin logic is handled for non-standalone builds is in qt_internal_add_executable - adding the library later when encountered in one tests that get batched does not trigger plugin handling logic. Fixes: QTBUG-109812 Change-Id: Idcc2bc6b42b2b7ad6afb9796f554b0529de3de5f Reviewed-by: Jörg Bornemann --- cmake/QtTestHelpers.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake index 79c5b5b5d0..f84e0917b1 100644 --- a/cmake/QtTestHelpers.cmake +++ b/cmake/QtTestHelpers.cmake @@ -297,6 +297,11 @@ function(qt_internal_add_test_to_batch batch_name name) LIBRARIES ${QT_CMAKE_EXPORT_NAMESPACE}::Core ${QT_CMAKE_EXPORT_NAMESPACE}::Test ${QT_CMAKE_EXPORT_NAMESPACE}::TestPrivate + # Add GUI by default so that the plugins link properly with non-standalone + # build of tests. Plugin handling is currently only done in + # qt_internal_add_executable if Gui is present. This should be reevaluated with + # multiple batches. + ${QT_CMAKE_EXPORT_NAMESPACE}::Gui ) set_property(TARGET ${target} PROPERTY _qt_has_exceptions ${arg_EXCEPTIONS})