cmake: use correct suffix in PkgConfigHelper

(cherry picked from commit 0bbfbf5b37)
This commit is contained in:
Anonymous Maarten
2025-10-03 20:58:45 +02:00
parent 54fb312a2c
commit d3aff13aa3

View File

@@ -1,16 +1,21 @@
# Helper for Find modules # Helper for Find modules
function(get_flags_from_pkg_config _library _pc_prefix _out_prefix) function(get_flags_from_pkg_config _library _pc_prefix _out_prefix)
if("${_library}" MATCHES "${CMAKE_STATIC_LIBRARY_SUFFIX}$") if(MINGW)
set(_cflags ${_pc_prefix}_STATIC_CFLAGS_OTHER) set(re_shared_suffix ".dll.a$")
set(_link_libraries ${_pc_prefix}_STATIC_LIBRARIES)
set(_link_options ${_pc_prefix}_STATIC_LDFLAGS_OTHER)
set(_library_dirs ${_pc_prefix}_STATIC_LIBRARY_DIRS)
else() else()
set(re_shared_suffix "${CMAKE_SHARED_LIBRARY_SUFFIX}$")
endif()
if("${_library}" MATCHES "${re_shared_suffix}")
set(_cflags ${_pc_prefix}_CFLAGS_OTHER) set(_cflags ${_pc_prefix}_CFLAGS_OTHER)
set(_link_libraries ${_pc_prefix}_LIBRARIES) set(_link_libraries ${_pc_prefix}_LIBRARIES)
set(_link_options ${_pc_prefix}_LDFLAGS_OTHER) set(_link_options ${_pc_prefix}_LDFLAGS_OTHER)
set(_library_dirs ${_pc_prefix}_LIBRARY_DIRS) set(_library_dirs ${_pc_prefix}_LIBRARY_DIRS)
else()
set(_cflags ${_pc_prefix}_STATIC_CFLAGS_OTHER)
set(_link_libraries ${_pc_prefix}_STATIC_LIBRARIES)
set(_link_options ${_pc_prefix}_STATIC_LDFLAGS_OTHER)
set(_library_dirs ${_pc_prefix}_STATIC_LIBRARY_DIRS)
endif() endif()
# The *_LIBRARIES lists always start with the library itself # The *_LIBRARIES lists always start with the library itself