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
Pick-to: 6.0 6.1
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>
This commit is contained in:
Assam Boudjelthia 2021-02-09 20:21:22 +02:00
parent 41e3d167d5
commit 85c7a9d3a6

View File

@ -240,7 +240,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
)
@ -254,6 +253,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)