From 1c979992a6d8736e0f3944716d7d1ba39c8b2eff Mon Sep 17 00:00:00 2001 From: Jim-Wang Date: Tue, 24 Oct 2023 08:31:31 +0000 Subject: [PATCH] Add the suffix of dll. --- CMake/glfw3.pc.in | 2 +- src/CMakeLists.txt | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) 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..4a272f74 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -387,7 +387,12 @@ set(GLFW_PKG_CONFIG_REQUIRES_PRIVATE "${deps}" CACHE INTERNAL "GLFW pkg-config Requires.private") set(GLFW_PKG_CONFIG_LIBS_PRIVATE "${libs}" CACHE INTERNAL "GLFW pkg-config Libs.private") - +set(GLFW_LIB_NAME_SUFFIX "") +if (BUILD_SHARED_LIBS) + if (WIN32) + set(GLFW_LIB_NAME_SUFFIX "dll") + endif() +endif() configure_file("${GLFW_SOURCE_DIR}/CMake/glfw3.pc.in" glfw3.pc @ONLY) if (GLFW_INSTALL)