1. 14 Feb, 2024 1 commit
  2. 21 Jan, 2024 1 commit
    • Yann E. MORIN's avatar
      CMakeList: add option to not install NuGet packaging · ff7a0644
      Yann E. MORIN authored
      
      
      The NuGet hiredis.target packaging description file is of no use on
      systems that are not using NuGet, like Linux systems, and the spurious
      presence of that file is not "clean".
      
      Add a cmake option to allow users to disable installation of that file.
      As some people may have relied on that file to be installed, continue to
      install it by default.
      Signed-off-by: default avatarYann E. MORIN <yann.morin.1998@free.fr>
      ff7a0644
  3. 08 Mar, 2023 1 commit
    • autoantwort's avatar
      Cmake static or shared (#1160) · e9243d4f
      autoantwort authored
      
      
      * cmake: build either static or shared libs
      
      * cmake: allow to build non-PIC static libs
      
      * fix typo
      
      * cmake: add ALIAS targets
      
      * cmake: link to OpenSSL imported targets
      
      CMake imported targets are more robust
      
      * turn ENABLE_EXAMPLES to a CMake option
      
      * fix typo
      
      * install pdb files if shared
      
      * fix hiredis_ssl-config file
      
      * Fix more targets
      
      * CMake knows when to enable CMAKE_POSITION_INDEPENDENT_CODE
      
      * Restore setting of /Z7
      
      * [ci] fix building of shared and static libs
      
      * Apply suggestions from code review
      Co-authored-by: default avatarBjorn Svensson <bjorn.a.svensson@est.tech>
      
      * Make it possible to change name of exported target
      
      ---------
      Co-authored-by: default avatarSpaceIm <30052553+SpaceIm@users.noreply.github.com>
      Co-authored-by: default avatarBjorn Svensson <bjorn.a.svensson@est.tech>
      e9243d4f
  4. 24 Feb, 2023 1 commit
    • Dominik Charousset's avatar
      Write a version file for the CMake package (#1165) · 1cbd5bc7
      Dominik Charousset authored
      * Write a version file for the CMake package
      
      > If no VERSION is given, the PROJECT_VERSION variable is used.
      
      Since we set the project version to `${VERSION}`, we can safely skip
      passing it to `write_basic_package_version_file` as well.
      1cbd5bc7
  5. 27 Dec, 2022 1 commit
  6. 29 Sep, 2022 1 commit
    • Bjorn Svensson's avatar
      CMake corrections for building on Windows (#1122) · c245df9f
      Bjorn Svensson authored
      * Replace use of newer CMake builtins than in v3.0.0
      
      Visual Studio generator will replace -D with /D.
      
      * Only use /Z7 flag on a Visual Studio compilator
      
      Flag is not available on a GNU compilator running on windows,
      like in a mingw64 setup.
      c245df9f
  7. 27 Sep, 2022 1 commit
    • Bjorn Svensson's avatar
      Install on windows fixes (#1117) · 6d5c3ee7
      Bjorn Svensson authored
      * Remove attempt to install .pdb file for windows static lib
      
      From ff57c18b (#1054) the debug information was embedded in the
      windows static lib rather than creating a .pdb file.
      Removing the installation step of this file in CMake when building
      with buildtype Debug or RelWithDebInfo.
      
      * Embed debug information in windows hiredis_ssl_static lib
      
      See ff57c18b (#1054) for same change in library hiredis_static.
      6d5c3ee7
  8. 01 Sep, 2022 2 commits
    • Tongliang Liao's avatar
      Fix cmake config path on Linux. · 35d398c9
      Tongliang Liao authored
      CMake config files were installed to `/usr/local/share/hiredis`, which is not recognizable by `find_package()`.
      I'm not sure why it was set that way.
      Given the commit introducing it is for Windows, I keep that behavior consistent there, but fix the rest.
      35d398c9
    • michael-grunder's avatar
      Polling adapter requires sockcompat.h · eaae7321
      michael-grunder authored
      We need to install our socket compatibility header as the new polling
      adapter needs it.
      eaae7321
  9. 29 Aug, 2022 1 commit
  10. 29 Mar, 2022 1 commit
  11. 24 Mar, 2022 1 commit
  12. 18 Mar, 2022 1 commit
  13. 24 Jan, 2022 1 commit
  14. 09 Jan, 2022 1 commit
    • Fabrice Fontaine's avatar
      CMakeLists.txt: allow building without a C++ compiler (#872) · 24d53449
      Fabrice Fontaine authored
      Define hiredis as a C project (and use a single PROJECT statement) to
      avoid the following build failure if a C++ compiler is not found:
      
      CMake Error at CMakeLists.txt:3 (PROJECT):
        The CMAKE_CXX_COMPILER:
      
          /srv/storage/autobuild/run/instance-1/output-1/host/bin/arm-linux-g++
      
        is not a full path to an existing compiler tool.
      
        Tell CMake where to find the compiler by setting either the environment
        variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
        to the compiler, or to the compiler name if it is in the PATH.
      
      The only cpp source file is examples/example-qt.cpp which is never
      compiled with cmake buildsystem. This file is compiled only with the
      Makefile buildsystem so perhaps it should be removed. If it is added to
      the cmake buildsystem, a call to enable_language(CXX) will have to be
      added.
      
      Fixes:
       - http://autobuild.buildroot.org/results/830ec3398cd29b9fc5cde06a225ef531d7a9d850
      
      Signed-off-by: default avatarFabrice Fontaine <fontaine.fabrice@gmail.com>
      24d53449
  15. 22 Dec, 2021 1 commit
    • Eric Deng's avatar
      Update CMakeLists.txt for more portability (#1005) · f347743b
      Eric Deng authored
      add alias hiredis::hiredis and hiredis::hiredis_static so when this project is FetchContent, it behave the same as find_package-ed.
      e.g.
      ```
      find_package(hiredis 1.0.2 QUIET)
      if (NOT hiredis_FOUND)
          FetchContent_Declare(
                  hiredis
                  GIT_REPOSITORY https://github.com/redis/hiredis.git
                  GIT_TAG v1.0.2
          )
          FetchContent_MakeAvailable(hiredis)
      endif ()
      # later
      target_link_libraries(target **hiredis::hiredis**) #can always use hiredis::hiredis to ref to this project. no matter find_package or FetchContent
      ```
      this is actually sort of best practice when making a CMake lib.
      f347743b
  16. 16 Dec, 2021 1 commit
  17. 26 Oct, 2021 1 commit
    • Björn Svensson's avatar
      Add build options for enabling async tests · 648763c3
      Björn Svensson authored
      Asynchronous testcases that requires the event library `libevent`
      can be built and enabled by using the added build flags:
      - ENABLE_ASYNC_TESTS when using CMake
      - TEST_ASYNC when using Make
      
      The async tests are disabled by default to avoid adding new requirements,
      but the testcases are built and run in CI.
      648763c3
  18. 09 Oct, 2021 1 commit
  19. 09 Sep, 2020 3 commits
  20. 08 Sep, 2020 1 commit
  21. 07 Sep, 2020 1 commit
  22. 28 Aug, 2020 1 commit
  23. 30 Jul, 2020 1 commit
  24. 29 Jul, 2020 1 commit
    • Michael Grunder's avatar
      Move SSL management to a distinct private pointer. (#855) · d8ff7238
      Michael Grunder authored
      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
      d8ff7238
  25. 22 Jul, 2020 1 commit
  26. 22 May, 2020 1 commit
    • Michael Grunder's avatar
      Allow users to replace allocator and handle OOM everywhere. (#800) · 8e0264cf
      Michael Grunder authored
      * Adds an indirection to every allocation/deallocation to allow users to 
        plug in ones of their choosing (use custom functions, jemalloc, etc).
      
      * Gracefully handle OOM everywhere in hiredis.  This should make it possible
        for users of the library to have more flexibility in how they handle such situations.
      
      * Changes `redisReaderTask->elements` from an `int` to a `long long` to prevent
        a possible overflow when transferring the task elements into a `redisReply`.
      
      * Adds a configurable `max elements` member to `redisReader` that defaults to
        2^32 - 1.  This can be set to "unlimited" by setting the value to zero.
      8e0264cf
  27. 13 Apr, 2020 1 commit
  28. 09 Apr, 2020 1 commit
  29. 07 Apr, 2020 1 commit
  30. 03 Apr, 2020 1 commit
    • Michael Grunder's avatar
      Win32 tests and timeout fix (#776) · cc9d0329
      Michael Grunder authored
      Unit tests in Windows and a Windows timeout fix
      
      This commit gets our unit tests compiling and running on Windows as well as removes a duplicated `timeval` -> `DWORD` conversion logic in sockcompat.c 
      
      There are minor differences in behavior between Linux and Windows to note:
      
      1.  In Windows, opening a non-existent hangs forever in WSAPoll whereas
          it correctly returns with a "Connection refused" error on Linux.
          For that reason, I simply skip this test in Windows.
      
          It may be related to this known issue:
          https://daniel.haxx.se/blog/2012/10/10/wsapoll-is-broken/
      
      2.  Timeouts are handled slightly differently in Windows and Linux.  
          In Linux, we intentionally set REDIS_ERR_IO for connection
          timeouts whereas in Windows we set REDIS_ERR_TIMEOUT.  It may be
          prudent to fix this discrepancy although there are almost certainly
          users relying on the current behavior.
      cc9d0329
  31. 28 Feb, 2020 1 commit
    • Michael Grunder's avatar
      Housekeeping fixes (#764) · 38675d23
      Michael Grunder authored
      Housekeeping
      
      * Check for C++ (#758, #750) 
      * Include `alloc.h` in `make install` and `cmake`
      * Add a `.def` file for Windows (#760)
      * Include allocation wrappers referenced in adapter headers
      * Fix minor syntax errors and typos in README
      * Fix CI in Windows by properly escaping arguments (#761)
      38675d23
  32. 28 Jan, 2020 1 commit
  33. 04 Nov, 2019 1 commit
    • Paul Botros's avatar
      Adding an option to DISABLE_TESTS · f052fd1a
      Paul Botros authored
      Useful when hiredis is used as a CMake dependency in other projects and
      added via add_subdirectory(). With DISABLE_TESTS on, `make test` in the
      parent project won't run hiredis tests.
      f052fd1a
  34. 01 Sep, 2019 1 commit
  35. 29 Aug, 2019 1 commit
  36. 17 Jul, 2019 1 commit
  37. 01 Apr, 2019 1 commit
    • m's avatar
      CMake: Minor modernization · e38cd755
      m authored
      Rely more on transitive dependencies, as provided by
      TARGET_LINK_LIBRARIES. Avoid using ADD_DEFINITIONS and
      INCLUDE_DIRECTORIES. This avoids leakage/pollution of defines and
      includes.
      e38cd755