File kf5-add-lib-prefix-to-qml-plugins.patch of Package mingw64-extra-cmake-modules
diff -ur extra-cmake-modules-5.103.0.orig/modules/ECMQmlModule.cmake extra-cmake-modules-5.103.0/modules/ECMQmlModule.cmake
--- extra-cmake-modules-5.103.0.orig/modules/ECMQmlModule.cmake 2023-01-23 13:24:05.000000000 +0100
+++ extra-cmake-modules-5.103.0/modules/ECMQmlModule.cmake 2024-07-18 11:20:00.286683382 +0200
@@ -250,7 +250,7 @@
# to.
add_custom_target(${ARG_TARGET} ALL)
else()
- add_library(${ARG_TARGET})
+ add_library(${ARG_TARGET} MODULE)
endif()
if ("${ARG_VERSION}" STREQUAL "")
@@ -266,10 +266,11 @@
${_ECM_QMLMODULE_PROPERTY_DEPENDS} ""
)
- # QQmlImportDatabase::resolvePlugin doesn't accept lib prefixes under
- # Windows, causing to fail to import when using as a dynamic plugin.
+ # To match the used prefix in QQmlImportDatabase::resolvePlugin
+ # MinGW builds must have a lib prefix, which is not set when
+ # creating a module by default.
if (MINGW)
- set_target_properties(${ARG_TARGET} PROPERTIES PREFIX "")
+ set_target_properties(${ARG_TARGET} PROPERTIES PREFIX "lib")
endif()
# -Muri is required for static QML plugins to work properly, see