From 22396e2aa40cef8434bda2f6c244741323020fbe Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 13 Dec 2011 16:42:03 +0300 Subject: [PATCH] Fix build with system-wide libhiredis. --- CMakeLists.txt | 3 +++ config.h.in | 2 ++ src/lua/lua_redis.c | 8 ++++++++ 3 files changed, 13 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index cca151f26e..6bf8884a80 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -344,6 +344,9 @@ ENDIF(HIREDIS_INCLUDE_DIRS) IF(HIREDIS_LIBRARY_DIRS) LINK_DIRECTORIES("${HIREDIS_LIBRARY_DIRS}") ENDIF(HIREDIS_LIBRARY_DIRS) +IF(HIREDIS_FOUND) + SET(WITH_SYSTEM_HIREDIS 1) +ENDIF(HIREDIS_FOUND) # Try to link with gmime24 IF(NOT GMIME2_FOUND OR FORCE_GMIME24) diff --git a/config.h.in b/config.h.in index 1a781a1719..999340f075 100644 --- a/config.h.in +++ b/config.h.in @@ -163,6 +163,8 @@ #cmakedefine WITH_GPERF_TOOLS 1 +#cmakedefine WITH_SYSTEM_HIREDIS 1 + #cmakedefine HAVE_ASM_PAUSE 1 #cmakedefine BUILD_STATIC 1 diff --git a/src/lua/lua_redis.c b/src/lua/lua_redis.c index e4f1f996c0..5b845108e0 100644 --- a/src/lua/lua_redis.c +++ b/src/lua/lua_redis.c @@ -23,9 +23,17 @@ #include "lua_common.h" #include "dns.h" + +#ifndef WITH_SYSTEM_HIREDIS #include "hiredis.h" #include "async.h" #include "adapters/libevent.h" +#else +#include +#include +#include +#endif + /** * Redis access API for lua from task object -- 2.47.3