1*4882a593SmuzhiyunFrom 0ce382c275b087e866517c003e565f8cc4855bdd Mon Sep 17 00:00:00 2001 2*4882a593SmuzhiyunFrom: Fabrice Fontaine <fontaine.fabrice@gmail.com> 3*4882a593SmuzhiyunDate: Sat, 29 Aug 2020 23:19:26 +0200 4*4882a593SmuzhiyunSubject: [PATCH] CMakeLists.txt: do not force SHARED 5*4882a593Smuzhiyun 6*4882a593SmuzhiyunAllow the user to build static libraries by removing SHARED from 7*4882a593SmuzhiyunADD_LIBRARY calls. 8*4882a593Smuzhiyun 9*4882a593SmuzhiyunHere is an extract of 10*4882a593Smuzhiyunhttps://cmake.org/cmake/help/latest/command/add_library.html: 11*4882a593Smuzhiyun 12*4882a593Smuzhiyun"If no type is given explicitly the type is STATIC or SHARED based on 13*4882a593Smuzhiyunwhether the current value of the variable BUILD_SHARED_LIBS is ON." 14*4882a593Smuzhiyun 15*4882a593SmuzhiyunSigned-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> 16*4882a593Smuzhiyun[Upstream status: probably not upstreamable as is because it will 17*4882a593Smuzhiyunconflict with https://github.com/redis/hiredis/pull/851. So, this patch 18*4882a593Smuzhiyunwill probably have to be reworked for 1.0.x] 19*4882a593Smuzhiyun--- 20*4882a593Smuzhiyun CMakeLists.txt | 4 ++-- 21*4882a593Smuzhiyun 1 file changed, 2 insertions(+), 2 deletions(-) 22*4882a593Smuzhiyun 23*4882a593Smuzhiyundiff --git a/CMakeLists.txt b/CMakeLists.txt 24*4882a593Smuzhiyunindex 1beccc6..fed79fd 100644 25*4882a593Smuzhiyun--- a/CMakeLists.txt 26*4882a593Smuzhiyun+++ b/CMakeLists.txt 27*4882a593Smuzhiyun@@ -40,7 +40,7 @@ IF(WIN32) 28*4882a593Smuzhiyun ADD_COMPILE_DEFINITIONS(_CRT_SECURE_NO_WARNINGS WIN32_LEAN_AND_MEAN) 29*4882a593Smuzhiyun ENDIF() 30*4882a593Smuzhiyun 31*4882a593Smuzhiyun-ADD_LIBRARY(hiredis SHARED ${hiredis_sources}) 32*4882a593Smuzhiyun+ADD_LIBRARY(hiredis ${hiredis_sources}) 33*4882a593Smuzhiyun 34*4882a593Smuzhiyun SET_TARGET_PROPERTIES(hiredis 35*4882a593Smuzhiyun PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE 36*4882a593Smuzhiyun@@ -97,7 +97,7 @@ IF(ENABLE_SSL) 37*4882a593Smuzhiyun FIND_PACKAGE(OpenSSL REQUIRED) 38*4882a593Smuzhiyun SET(hiredis_ssl_sources 39*4882a593Smuzhiyun ssl.c) 40*4882a593Smuzhiyun- ADD_LIBRARY(hiredis_ssl SHARED 41*4882a593Smuzhiyun+ ADD_LIBRARY(hiredis_ssl 42*4882a593Smuzhiyun ${hiredis_ssl_sources}) 43*4882a593Smuzhiyun 44*4882a593Smuzhiyun IF (APPLE) 45*4882a593Smuzhiyun-- 46*4882a593Smuzhiyun2.28.0 47*4882a593Smuzhiyun 48