Module: kamailio Branch: 6.0 Commit: 9731c735d59e07f82c578b6910e37ae109e539f2 URL: https://github.com/kamailio/kamailio/commit/9731c735d59e07f82c578b6910e37ae109e539f2
Author: Xenofon Karamanos <[email protected]> Committer: Xenofon Karamanos <[email protected]> Date: 2025-10-06T11:29:54Z db_redis: cmake: Add ssl support (cherry picked from commit 4f436ee4881e954fa6fc152c02ac5ddc52ff936c) --- Modified: src/modules/db_redis/CMakeLists.txt --- Diff: https://github.com/kamailio/kamailio/commit/9731c735d59e07f82c578b6910e37ae109e539f2.diff Patch: https://github.com/kamailio/kamailio/commit/9731c735d59e07f82c578b6910e37ae109e539f2.patch --- diff --git a/src/modules/db_redis/CMakeLists.txt b/src/modules/db_redis/CMakeLists.txt index 0a1c48a5301..031ba738b86 100644 --- a/src/modules/db_redis/CMakeLists.txt +++ b/src/modules/db_redis/CMakeLists.txt @@ -3,9 +3,27 @@ file(GLOB MODULE_SOURCES "*.c") add_library(${module_name} SHARED ${MODULE_SOURCES}) find_package(PkgConfig REQUIRED) -pkg_check_modules(redis REQUIRED IMPORTED_TARGET hiredis) -add_library(redis::redis ALIAS PkgConfig::redis) +pkg_check_modules(hiredis REQUIRED IMPORTED_TARGET hiredis) +add_library(hiredis::hiredis ALIAS PkgConfig::hiredis) -# TODO: Check with Makefile for cluster stuff +target_link_libraries(${module_name} PRIVATE hiredis::hiredis) + +# Check for hiredis SSL support +pkg_check_modules(hiredis_ssl IMPORTED_TARGET hiredis_ssl) + +if(hiredis_ssl_FOUND) + find_package(OpenSSL REQUIRED) + # hiredis_ssl found via pkg-config + add_library(hiredis::hiredis_ssl ALIAS PkgConfig::hiredis_ssl) + target_compile_definitions(${module_name} PRIVATE WITH_SSL) + target_link_libraries(${module_name} PRIVATE hiredis::hiredis_ssl) + # https://github.com/redis/hiredis?tab=readme-ov-file#using-it + target_link_libraries(${module_name} PRIVATE OpenSSL::SSL OpenSSL::Crypto) +endif() -target_link_libraries(${module_name} PRIVATE redis::redis) +# TODO: Revise when this definition is needed +# ifeq (,$(findstring hiredis,$(HIREDISDEFS))) +# DEFS+=-DWITH_HIREDIS_PATH +# endif + +# TODO: Check with Makefile for cluster stuff _______________________________________________ Kamailio - Development Mailing List -- [email protected] To unsubscribe send an email to [email protected] Important: keep the mailing list in the recipients, do not reply only to the sender!
