summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMichael Grunder <michael.grunder@gmail.com>2020-07-29 11:53:03 -0700
committerGitHub <noreply@github.com>2020-07-29 11:53:03 -0700
commitd8ff72387d5474e56228a3403dc91354d9916189 (patch)
tree1a6fa645967132b78d92d52de9c9175b429236ba /CMakeLists.txt
parentbe32bcdc8e84ae7dc091ceeffca2c5d4126f415c (diff)
Move SSL management to a distinct private pointer. (#855)
We need to allow our users to use redisContext->privdata as context for any RESP3 PUSH messages, which means we can't use it for managing SSL connections. Bulletpoints: * Create a secondary redisContext member for internal use only called privctx and rename the redisContextFuncs->free_privdata accordingly. * Adds a `free_privdata` function pointer so the user can tie allocated memory to the lifetime of a redisContext (like they can already do with redisAsyncContext) * Enables SSL tests in .travis.yml
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt8
1 files changed, 7 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 87a4ac6..f86c9b7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,6 +4,7 @@ PROJECT(hiredis)
OPTION(ENABLE_SSL "Build hiredis_ssl for SSL support" OFF)
OPTION(DISABLE_TESTS "If tests should be compiled or not" OFF)
+OPTION(ENABLE_SSL_TESTS, "Should we test SSL connections" OFF)
MACRO(getVersionBit name)
SET(VERSION_REGEX "^#define ${name} (.+)$")
@@ -148,7 +149,12 @@ ENDIF()
IF(NOT DISABLE_TESTS)
ENABLE_TESTING()
ADD_EXECUTABLE(hiredis-test test.c)
- TARGET_LINK_LIBRARIES(hiredis-test hiredis)
+ IF(ENABLE_SSL_TESTS)
+ ADD_DEFINITIONS(-DHIREDIS_TEST_SSL=1)
+ TARGET_LINK_LIBRARIES(hiredis-test hiredis hiredis_ssl)
+ ELSE()
+ TARGET_LINK_LIBRARIES(hiredis-test hiredis)
+ ENDIF()
ADD_TEST(NAME hiredis-test
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test.sh)
ENDIF()