FindPkgConfig: Regression in 3.24.0-rc1 tries to link .dll instead of .lib on Windows
CMAKE_FIND_LIBRARY_SUFFIXES
is set to CMAKE_SHARED_LIBRARY_SUFFIX
which is defined as .dll
.
This is wrong behavior, since CMAKE_SHARED_LIBRARY_SUFFIX
is meant to be the suffix for the target binary file, which is on Windows not the same with the linker file. Therefore, this must not happen.
Possible solution: Rename CMAKE_SHARED_LIBRARY_SUFFIX to CMAKE_FIND_SHARED_LIBRARY_SUFFIX and define it as .dll.a;.lib (mingw | msvc)
CMAKE_SHARED_LIBRARY_SUFFIX
The suffix for shared libraries that you link to.
The suffix to use for the end of a shared library filename, .dll on Windows.
CMAKE_SHARED_LIBRARY_SUFFIX_<LANG> overrides this for language <LANG>.
https://gitlab.kitware.com/cmake/cmake/-/blob/v3.24.0-rc1/Modules/FindPkgConfig.cmake#L269-L281
Edited by Brad King