1
0
Fork 0
forked from fun/fun

Added a Redis/Valkey extension named redis. (0.42.0)

This commit is contained in:
Johannes Findeisen 2026-06-03 21:48:45 +02:00
commit cbb81c0b93
28 changed files with 798 additions and 15 deletions

View 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()