diff options
| author | Julius Künzel <jk.kdedev@smartlab.uber.space> | 2022-04-23 15:16:08 +0000 |
|---|---|---|
| committer | Julius Künzel <jk.kdedev@smartlab.uber.space> | 2022-04-23 15:16:08 +0000 |
| commit | 7e8c2634dd994a923bf389f561f74e54a28063b6 (patch) | |
| tree | 8dffa6771a1db58becdf4cecac52c0f87a8beb87 | |
| parent | 997bd09f326e065cff6fa58c081f14c1d7aee6e5 (diff) | |
| download | extra-cmake-modules-7e8c2634dd994a923bf389f561f74e54a28063b6.tar.gz extra-cmake-modules-7e8c2634dd994a923bf389f561f74e54a28063b6.tar.bz2 | |
Drop lib prefix when building for Windows (MinGW)
QQmlImportDatabase::resolvePlugin doesn't accept lib prefixes under
Windows, causing to fail to import when using as a dynamic plugin.
Inspired by kirigami!34
| -rw-r--r-- | modules/ECMQmlModule.cmake | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/ECMQmlModule.cmake b/modules/ECMQmlModule.cmake index e57c7ec0..f3d215b9 100644 --- a/modules/ECMQmlModule.cmake +++ b/modules/ECMQmlModule.cmake @@ -266,6 +266,12 @@ function(ecm_add_qml_module ARG_TARGET) ${_ECM_QMLMODULE_PROPERTY_DEPENDS} "" ) + # QQmlImportDatabase::resolvePlugin doesn't accept lib prefixes under + # Windows, causing to fail to import when using as a dynamic plugin. + if (MINGW) + set_target_properties(${ARG_TARGET} PROPERTIES PREFIX "") + endif() + # -Muri is required for static QML plugins to work properly, see # https://bugreports.qt.io/browse/QTBUG-82598 set_target_properties(${ARG_TARGET} PROPERTIES AUTOMOC_MOC_OPTIONS -Muri=${ARG_URI}) |
