Skip to content

Fix plugins CMakeLists to pass build with MinGW on Windows

Weixuan Xiao requested to merge (removed):mingw-build into master

In current version of MinGW, the required header file "Functiondiscoverykeys_devpkey.h" has only one definition of PKEY_*:

DEFINE_PROPERTYKEY(PKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd,
0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14);

which will cause reference not found during the build on Windows. It will influence PKEY_Device_DeviceDesc inplugins/systemvolumeplugin-win.cpp Line 266 and Line 270.

For now the solution is excluding systemvolume plugin while building with MinGW on Windows:

plugins/CMakeLists.txt Line 41 from

if(KF5PulseAudioQt_FOUND OR WIN32)

to:

if(KF5PulseAudioQt_FOUND OR (WIN32 AND NOT "${CMAKE_CXX_COMPILER_ID}"
STREQUAL "GNU"))

Configuration is same as https://community.kde.org/KDEConnect/Build_Windows

The difference is in the compiler choosing step, instead of

Select compiler
[0] Mingw-w64, [1] Microsoft Visual Studio 2015, [2] Microsoft Visual Studio 2017 (default is Microsoft Visual Studio 2015): 2
Select architecture
[0] x86 [1] x64 (Default is x64): 1

we use

Select compiler
[0] Mingw-w64, [1] Microsoft Visual Studio 2015, [2] Microsoft Visual Studio 2017 (default is Microsoft Visual Studio 2015): 0
Select architecture
[0] x86 [1] x64 (Default is x64): 1

Merge request reports

Loading