Added a Redis/Valkey extension named redis. (0.42.0)
This commit is contained in:
parent
06072576fc
commit
cbb81c0b93
28 changed files with 798 additions and 15 deletions
22
cmake/Extensions/REDIS.cmake
Normal file
22
cmake/Extensions/REDIS.cmake
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# Redis (hiredis)
|
||||
option(FUN_WITH_REDIS "Enable Redis (hiredis) support" ON)
|
||||
set(HIREDIS_INCLUDE_DIRS "")
|
||||
set(HIREDIS_LINK_LIBS "")
|
||||
if(FUN_WITH_REDIS)
|
||||
add_definitions(-DFUN_WITH_REDIS)
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(HIREDIS QUIET hiredis)
|
||||
endif()
|
||||
if(HIREDIS_FOUND)
|
||||
list(APPEND HIREDIS_INCLUDE_DIRS ${HIREDIS_INCLUDE_DIRS} ${HIREDIS_INCLUDE_DIRS})
|
||||
list(APPEND HIREDIS_LINK_LIBS ${HIREDIS_LINK_LIBS} ${HIREDIS_LIBRARIES})
|
||||
else()
|
||||
find_library(HIREDIS_LIB hiredis)
|
||||
if(HIREDIS_LIB)
|
||||
list(APPEND HIREDIS_LINK_LIBS ${HIREDIS_LIB})
|
||||
else()
|
||||
message(FATAL_ERROR "hiredis not found. Install hiredis (dev headers) or disable FUN_WITH_REDIS.")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
Loading…
Add table
Add a link
Reference in a new issue