From c754de5deb1fb339a76fe70fe28687e0f681ef83 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 This was adapted to 3.3-stable from 93a3ba808067134b5a964b1a1c44701450386fe4. --- CMakeLists.txt | 5 +++++ src/CMakeLists.txt | 1 + src/glfw3.pc.in | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 50b62e5a..b035b984 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,6 +45,7 @@ if (BUILD_SHARED_LIBS AND UNIX) else() set(GLFW_LIB_NAME glfw3) endif() +set(GLFW_LIB_NAME_SUFFIX "") if (GLFW_VULKAN_STATIC) if (BUILD_SHARED_LIBS) @@ -196,6 +197,10 @@ if (_GLFW_WIN32) if (GLFW_USE_HYBRID_HPG) set(_GLFW_USE_HYBRID_HPG 1) endif() + + if (BUILD_SHARED_LIBS) + set (GLFW_LIB_NAME_SUFFIX "dll") + endif() endif() #-------------------------------------------------------------------- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b6dd86c5..efd65927 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -168,6 +168,7 @@ if (BUILD_SHARED_LIBS) # 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) elseif (APPLE) diff --git a/src/glfw3.pc.in b/src/glfw3.pc.in index f74298d4..17779ace 100644 --- a/src/glfw3.pc.in +++ b/src/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_DEPS@ -Libs: -L${libdir} -l@GLFW_LIB_NAME@ +Libs: -L${libdir} -l@GLFW_LIB_NAME@@GLFW_LIB_NAME_SUFFIX@ Libs.private: @GLFW_PKG_LIBS@ Cflags: -I${includedir}