Age | Commit message (Collapse) | Author |
|
* 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: Bjorn Svensson <bjorn.a.svensson@est.tech>
* Make it possible to change name of exported target
---------
Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com>
Co-authored-by: Bjorn Svensson <bjorn.a.svensson@est.tech>
|
|
* 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.
|
|
To allow building hiredis on toolchain without dynamic library support,
respect standard cmake BUILD_SHARED_LIBS:
https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
|
* 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.
|
|
* 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.
|
|
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.
|
|
We need to install our socket compatibility header as the new polling
adapter needs it.
|
|
Commit c6b8bd77c0fe00dbc455b39208f15761178160a3 to make all functions in dict.c static. If a CMake project set warning unused functions, and include hiredis using add_subdirectory , this cause warnings / errors.
|
|
fix cmake version
|
|
Use the same name for static and shared libraries
|
|
On all system except MSVC, the targets are different.
Unix: libhiredis.so, libhiredis.a
MinGW: libhiredis.dll+libhiredis.dll.a, libhiredis.a
MSVC: hiredis.dll+hiredis.lib, hiredis_static.lib
|
|
Using .pdb files with .lib files on windows is very inconvenient, particularly if the .lib
file is then linked as part of a different .dll. Chances are that the original .pdb
will not be picked up or distributed along with the tooling.
|
|
|
|
|
|
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: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
|
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.
|
|
* BSD linkage fix proposal
* Touch up the Makefile to fix BSD builds
Fixes #984
* Add a build in FreeBSD to GitHub Actions
Lots of people use hiredis in FreeBSD so this should reduce some pain
moving forward.
Co-authored-by: David Carlier <devnexen@gmail.com>
|
|
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.
|
|
Or it'll be treated as part of the var name.
|
|
|
|
builds (Release, RelWithDebInfo, etc)
|
|
|
|
|
|
|
|
|
|
See #869
|
|
|
|
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
|
|
|
|
* 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.
|
|
* Fix linker problems when building with SSL enabled on OSX
* Corrects `HIREDIS_SSL=ON` to `USE_SSL=ON` so we test building with
SSL enabled on travis.
|
|
* Add CMake package configuration so hiredis can be more easily included in
other projects.
* Fixes hiredis_ssl such that it compiles and works in windows
Co-authored-by: nrivera <nrivera@blizzard.com>
Co-authored-by: Nick <heronr1@gmail.com>
|
|
|
|
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.
|
|
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)
|
|
Create allocation wrappers with a configurable OOM handler (defaults to abort()).
See #752, #747
|
|
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.
|
|
Also rename the SSL option from `HIREDIS_SSL` to `ENABLE_SSL` to conform
with CMake convnetions.
|
|
|
|
|
|
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.
|
|
With this change, Hiredis builds with MinGW and runs on Windows.
|
|
|
|
|
|
Signed-off-by: Justin Brewer <jzb0012@auburn.edu>
|
|
Signed-off-by: Justin Brewer <jzb0012@auburn.edu>
|
|
Signed-off-by: Justin Brewer <jzb0012@auburn.edu>
|
|
Signed-off-by: Justin Brewer <jzb0012@auburn.edu>
|
|
Signed-off-by: Justin Brewer <jzb0012@auburn.edu>
|
|
Signed-off-by: Justin Brewer <jzb0012@auburn.edu>
|