Browse Source

* detect redis library presence

master
Alex 'AdUser' Z 8 years ago
parent
commit
4ab12a126d
  1. 1
      CMakeLists.txt
  2. 4
      src/backends/CMakeLists.txt

1
CMakeLists.txt

@ -10,6 +10,7 @@ option(WITH_CLIENT "Simple client for configuring daemon" ON)
option(WITH_CSOCKET "Unix control socket support for daemon" ON)
option(WITH_HARDENING "Enable hardening options" OFF)
option(WITH_PCRE "Build pcre-compatible filter" ON)
option(WITH_REDIS "Build redis backend" ON)
if (NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr")

4
src/backends/CMakeLists.txt

@ -4,10 +4,12 @@ set(BACKENDS "")
add_library("f2b_backend_exec" MODULE "exec.c")
list(APPEND BACKENDS "f2b_backend_exec")
# TODO: check if library available
find_library(REDIS_FOUND "pcre")
if (WITH_REDIS AND REDIS_FOUND)
add_library("f2b_backend_redis" MODULE "redis.c")
target_link_libraries("f2b_backend_redis" "hiredis")
list(APPEND BACKENDS "f2b_backend_redis")
endif ()
message(STATUS "- Backends : ${BACKENDS}")

Loading…
Cancel
Save