From 93a3ba808067134b5a964b1a1c44701450386fe4 Mon Sep 17 00:00:00 2001 From: moritz-h <7849248+moritz-h@users.noreply.github.com> Date: Wed, 15 Nov 2023 16:37:46 +0100 Subject: [PATCH] Win32: Add library name suffix to pkg-config file Closes #2386 --- CMake/glfw3.pc.in | 2 +- src/CMakeLists.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMake/glfw3.pc.in b/CMake/glfw3.pc.in index 37f4efd9..36ee218e 100644 --- a/CMake/glfw3.pc.in +++ b/CMake/glfw3.pc.in @@ -8,6 +8,6 @@ Description: A multi-platform library for OpenGL, window and input Version: @GLFW_VERSION@ URL: https://www.glfw.org/ Requires.private: @GLFW_PKG_CONFIG_REQUIRES_PRIVATE@ -Libs: -L${libdir} -l@GLFW_LIB_NAME@ +Libs: -L${libdir} -l@GLFW_LIB_NAME@@GLFW_LIB_NAME_SUFFIX@ Libs.private: @GLFW_PKG_CONFIG_LIBS_PRIVATE@ Cflags: -I${includedir} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 01f191c9..5acac0d0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -126,6 +126,7 @@ if (UNIX AND GLFW_BUILD_SHARED_LIBRARY) else() set(GLFW_LIB_NAME glfw3) endif() +set(GLFW_LIB_NAME_SUFFIX "") set_target_properties(glfw PROPERTIES OUTPUT_NAME ${GLFW_LIB_NAME} @@ -337,6 +338,7 @@ if (GLFW_BUILD_SHARED_LIBRARY) # Add a suffix to the import library to avoid naming conflicts set_target_properties(glfw PROPERTIES IMPORT_SUFFIX "dll.lib") endif() + set (GLFW_LIB_NAME_SUFFIX "dll") target_compile_definitions(glfw INTERFACE GLFW_DLL) endif()