Skip to content

fix: remove lib prefix for Windows

Gary Wang requested to merge garywang/plasma-framework:lib-prefix into master

This intended to fix https://github.com/msys2/MINGW-packages/issues/7393 so follow that link for details.

As a summary, the Windows build of plasma-framework generate *plugin.dll files which are native C++ QML plugin. The extra "lib" prefix will cause the QML engine won't be able to load those native C++ QML plugins, thus the projects that rely on plasma-framework won't be able to run as intended. This patch will remove the lib prefix for these targets.

I also notice that in KF5PlasmaMacros.cmake, plasma_add_plugin() will the remove-lib-prefix thing but it says it's deprecated and we should use add_library(MODULE). These modules mentioned in that issue both use SHARED and I'm not sure if it should be changed, so I add PREFIX "" to the target properties instead.

NOTE: Although I did test my patchset under both MSYS2 and KDE Craft (Windows), I'm still NOT sure if this patchset is the correct way to fix this issue, so please do review the code and test it if possible and let me know if there is any problem with this patchset.

Thanks!

Edited by Gary Wang

Merge request reports