Win32: Add library name suffix to pkg-config file

Closes #2386

This was adapted to 3.3-stable from
93a3ba8080.
This commit is contained in:
moritz-h 2023-11-15 16:37:46 +01:00 committed by Camilla Löwy
parent bf429fb628
commit c754de5deb
3 changed files with 7 additions and 1 deletions

View File

@ -45,6 +45,7 @@ if (BUILD_SHARED_LIBS AND UNIX)
else() else()
set(GLFW_LIB_NAME glfw3) set(GLFW_LIB_NAME glfw3)
endif() endif()
set(GLFW_LIB_NAME_SUFFIX "")
if (GLFW_VULKAN_STATIC) if (GLFW_VULKAN_STATIC)
if (BUILD_SHARED_LIBS) if (BUILD_SHARED_LIBS)
@ -196,6 +197,10 @@ if (_GLFW_WIN32)
if (GLFW_USE_HYBRID_HPG) if (GLFW_USE_HYBRID_HPG)
set(_GLFW_USE_HYBRID_HPG 1) set(_GLFW_USE_HYBRID_HPG 1)
endif() endif()
if (BUILD_SHARED_LIBS)
set (GLFW_LIB_NAME_SUFFIX "dll")
endif()
endif() endif()
#-------------------------------------------------------------------- #--------------------------------------------------------------------

View File

@ -168,6 +168,7 @@ if (BUILD_SHARED_LIBS)
# Add a suffix to the import library to avoid naming conflicts # Add a suffix to the import library to avoid naming conflicts
set_target_properties(glfw PROPERTIES IMPORT_SUFFIX "dll.lib") set_target_properties(glfw PROPERTIES IMPORT_SUFFIX "dll.lib")
endif() endif()
set (GLFW_LIB_NAME_SUFFIX "dll")
target_compile_definitions(glfw INTERFACE GLFW_DLL) target_compile_definitions(glfw INTERFACE GLFW_DLL)
elseif (APPLE) elseif (APPLE)

View File

@ -8,6 +8,6 @@ Description: A multi-platform library for OpenGL, window and input
Version: @GLFW_VERSION@ Version: @GLFW_VERSION@
URL: https://www.glfw.org/ URL: https://www.glfw.org/
Requires.private: @GLFW_PKG_DEPS@ Requires.private: @GLFW_PKG_DEPS@
Libs: -L${libdir} -l@GLFW_LIB_NAME@ Libs: -L${libdir} -l@GLFW_LIB_NAME@@GLFW_LIB_NAME_SUFFIX@
Libs.private: @GLFW_PKG_LIBS@ Libs.private: @GLFW_PKG_LIBS@
Cflags: -I${includedir} Cflags: -I${includedir}