CMake: add Qt::Gui dependency by default for Android tests

Normal Android apps require Qt::Gui dependency and since tests don't
need to handle any special cases for an app without Qt::Gui, let's add
it by default.

This also will allow us to remove some workarounds done on CI side to
run tests for Android.

Fixes: QTBUG-90870
Change-Id: I845650c17a1b73e4c4977043f863ec44e50f06c3
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
(cherry picked from commit 85c7a9d3a6710f8487ce4aa1e4e2d7d1d46b6cde)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Assam Boudjelthia 2021-02-09 20:21:22 +02:00 committed by Qt Cherry-pick Bot
parent dc34954d4c
commit 98e9275112

View File

@ -236,7 +236,6 @@ function(qt_internal_add_test name)
set_property(TARGET "${name}" PROPERTY WIN32_EXECUTABLE FALSE)
# QMLTest specifics
qt_internal_extend_target("${name}" CONDITION arg_QMLTEST
PUBLIC_LIBRARIES ${QT_CMAKE_EXPORT_NAMESPACE}::QuickTest
)
@ -250,6 +249,11 @@ function(qt_internal_add_test name)
DEFINES
QUICK_TEST_SOURCE_DIR=":/"
)
# Android requires Qt::Gui so add it by default for tests
qt_internal_extend_target("${name}" CONDITION ANDROID
PUBLIC_LIBRARIES ${QT_CMAKE_EXPORT_NAMESPACE}::Gui
)
endif()
foreach(path IN LISTS arg_QML_IMPORTPATH)