From a738fdf9338412f83ab3f26f31ac11ed3f3ec4bd Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Sat, 15 Jan 2022 21:37:57 +0530 Subject: [PATCH] cmake: Do not add suffix with static library names in mingw In mingw environment, this fixes static linking using pkgconfig file. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 998d733..b57c853 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -451,8 +451,8 @@ foreach (TYPE IN ITEMS STATIC SHARED) else () set (GFLAGS_IS_A_DLL 0) endif () - # filename suffix for static libraries on Windows - if (OS_WINDOWS AND "^${TYPE}$" STREQUAL "^STATIC$") + # filename suffix for static libraries on Windows for MSVC toolchain only + if (OS_WINDOWS AND NOT MINGW AND "^${TYPE}$" STREQUAL "^STATIC$") set (type_suffix "_${type}") else () set (type_suffix "")