Repair tst_qcoreapplication to not segfault on Android
tst_qcoreapplication.cpp is used both in tst_qcoreapplication and tst_qguiapplication. To distinguish these two compilations, the define QT_GUI_LIB was used. This led to an error on Android, where Qt::Gui is always linked, because the Qt Android Platform Plugin needs it. This patch introduces the preprocessor define QT_QGUIAPPLICATIONTEST which is to be used only in the compilation of tst_qguiapplication. This is then used instead of QT_GUI_LIB. Change-Id: Ifa5bfacb197d68365288c1da85573106515fc6c2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
da27a95aab
commit
21ce257b6c
@ -123,7 +123,7 @@ void tst_QCoreApplication::getSetCheck()
|
|||||||
|
|
||||||
void tst_QCoreApplication::qAppName()
|
void tst_QCoreApplication::qAppName()
|
||||||
{
|
{
|
||||||
#ifdef QT_GUI_LIB
|
#ifdef QT_QGUIAPPLICATIONTEST
|
||||||
const char* appName = "tst_qguiapplication";
|
const char* appName = "tst_qguiapplication";
|
||||||
#else
|
#else
|
||||||
const char* appName = "tst_qcoreapplication";
|
const char* appName = "tst_qcoreapplication";
|
||||||
@ -1078,7 +1078,7 @@ static void createQObjectOnDestruction()
|
|||||||
}
|
}
|
||||||
Q_DESTRUCTOR_FUNCTION(createQObjectOnDestruction)
|
Q_DESTRUCTOR_FUNCTION(createQObjectOnDestruction)
|
||||||
|
|
||||||
#ifndef QT_GUI_LIB
|
#ifndef QT_QGUIAPPLICATIONTEST
|
||||||
QTEST_APPLESS_MAIN(tst_QCoreApplication)
|
QTEST_APPLESS_MAIN(tst_QCoreApplication)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ qt_internal_add_test(tst_qguiapplication
|
|||||||
tst_qguiapplication.cpp
|
tst_qguiapplication.cpp
|
||||||
DEFINES
|
DEFINES
|
||||||
QT_DISABLE_DEPRECATED_BEFORE=0x050E00
|
QT_DISABLE_DEPRECATED_BEFORE=0x050E00
|
||||||
|
QT_QGUIAPPLICATIONTEST=1
|
||||||
INCLUDE_DIRECTORIES
|
INCLUDE_DIRECTORIES
|
||||||
../../../corelib/kernel/qcoreapplication
|
../../../corelib/kernel/qcoreapplication
|
||||||
PUBLIC_LIBRARIES
|
PUBLIC_LIBRARIES
|
||||||
|
Loading…
x
Reference in New Issue
Block a user