diff options
-rw-r--r-- | src/qml/Qt6QmlMacros.cmake | 4 | ||||
-rw-r--r-- | tests/auto/qml/qmlimportscanner/CMakeLists.txt | 7 | ||||
-rw-r--r-- | tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp | 12 |
3 files changed, 20 insertions, 3 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake index 4d2ee7af9a..b4acf4076d 100644 --- a/src/qml/Qt6QmlMacros.cmake +++ b/src/qml/Qt6QmlMacros.cmake @@ -268,9 +268,9 @@ function(qt6_add_qml_module target) set(qmldir_file_contents "module ${arg_URI}\n") if (arg_PLUGIN_OPTIONAL) - string(APPEND qmldir_file_contents "optional plugin ${target}\n") + string(APPEND qmldir_file_contents "optional plugin ${target}${QT_LIBINFIX}\n") else() - string(APPEND qmldir_file_contents "plugin ${target}\n") + string(APPEND qmldir_file_contents "plugin ${target}${QT_LIBINFIX}\n") endif() if (arg_CLASSNAME) diff --git a/tests/auto/qml/qmlimportscanner/CMakeLists.txt b/tests/auto/qml/qmlimportscanner/CMakeLists.txt index 66231beccb..ec69f00516 100644 --- a/tests/auto/qml/qmlimportscanner/CMakeLists.txt +++ b/tests/auto/qml/qmlimportscanner/CMakeLists.txt @@ -33,3 +33,10 @@ qt_internal_extend_target(tst_qmlimportscanner CONDITION NOT ANDROID AND NOT IOS DEFINES QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" ) + +# special case begin +qt_internal_extend_target(tst_qmlimportscanner CONDITION DEFINED QT_LIBINFIX + DEFINES + LIBINFIX=${QT_LIBINFIX} +) +# special case end diff --git a/tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp b/tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp index 2a6899080d..cfcec61f82 100644 --- a/tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp +++ b/tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp @@ -151,6 +151,16 @@ void TestQmlimportscanner::runQmlimportscanner(const QString &mode, const QStrin // Path is omitted because it's an absolute path, dependent on host system. object["path"] = QJsonValue::Undefined; +#ifdef LIBINFIX +#define XSTR(a) STR(a) +#define STR(A) #A + if (object.contains("plugin")) { + auto plugin = object["plugin"].toString(); + const auto pos = plugin.lastIndexOf(XSTR(LIBINFIX)); + if (pos != -1) + object["plugin"] = plugin.left(pos); + } +#endif bool found = false; for (auto it = expectedArray.begin(), end = expectedArray.end(); it != end; ++it) { @@ -160,7 +170,7 @@ void TestQmlimportscanner::runQmlimportscanner(const QString &mode, const QStrin break; } } - QVERIFY(found); + QVERIFY2(found, qPrintable(QDebug::toString(object))); } QVERIFY(expectedArray.isEmpty()); } |