-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add new package redis++ including hiredis #641
base: master
Are you sure you want to change the base?
Changes from all commits
ce3b014
6096855
878e0f9
7c47995
752f88a
7511a90
c0b8419
c049536
6ae9e8e
77ae5f7
9ee22dc
d9ae97f
614775d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[ | ||
{ "example": "HiRedis", "toolchain": "clang-cxx17", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "HiRedis", "toolchain": "gcc-7-cxx17", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "HiRedis", "toolchain": "gcc-8-cxx17-fpic", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "HiRedis", "toolchain": "gcc-9-cxx17-fpic", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "HiRedis", "toolchain": "sanitize-address-cxx17", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "HiRedis", "toolchain": "sanitize-leak-cxx17", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "HiRedis", "toolchain": "sanitize-thread-cxx17", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "HiRedis", "toolchain": "osx-10-15-make-cxx14", "os": "macos-10.15", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "HiRedis", "toolchain": "osx-12-3-arch-universal2-cxx17", "os": "macos-12", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "HiRedis", "toolchain": "ninja-vs-16-2019-win64-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" }, | ||
{ "example": "HiRedis", "toolchain": "nmake-vs-16-2019-win64-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" }, | ||
{ "example": "HiRedis", "toolchain": "vs-16-2019-win64-sdk-10-0-18362-0-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" }, | ||
{ "example": "HiRedis", "toolchain": "mingw-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" }, | ||
{ "example": "HiRedis", "toolchain": "msys-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" } | ||
] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# !!! DO NOT PLACE HEADER GUARDS HERE !!! | ||
|
||
include(hunter_add_version) | ||
include(hunter_cacheable) | ||
include(hunter_cmake_args) | ||
include(hunter_download) | ||
include(hunter_pick_scheme) | ||
include(hunter_report_broken_package) | ||
|
||
hunter_add_version( | ||
PACKAGE_NAME | ||
HiRedis | ||
VERSION | ||
1.1.0 | ||
URL | ||
"https://github.com/redis/hiredis/archive/refs/tags/v1.1.0.tar.gz" | ||
SHA1 | ||
6b3bae35134d2c0b3b1d884e157cfb03c90412da | ||
) | ||
|
||
hunter_pick_scheme(DEFAULT url_sha1_cmake) | ||
|
||
hunter_cmake_args(HiRedis CMAKE_ARGS DISABLE_TESTS=ON) | ||
|
||
hunter_cacheable(HiRedis) | ||
hunter_download(PACKAGE_NAME HiRedis) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. needed? if not please remove |
||
{ "example": "Redis++", "toolchain": "clang-cxx17", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "Redis++", "toolchain": "gcc-7-cxx17", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "Redis++", "toolchain": "gcc-8-cxx17-fpic", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "Redis++", "toolchain": "gcc-9-cxx17-fpic", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "Redis++", "toolchain": "sanitize-address-cxx17", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "Redis++", "toolchain": "sanitize-leak-cxx17", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "Redis++", "toolchain": "sanitize-thread-cxx17", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "Redis++", "toolchain": "osx-10-15-cxx17", "os": "macos-10.15", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "Redis++", "toolchain": "osx-12-3-arch-universal2-cxx17", "os": "macos-12", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "Redis++", "toolchain": "ninja-vs-16-2019-win64-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" }, | ||
{ "example": "Redis++", "toolchain": "nmake-vs-16-2019-win64-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" }, | ||
{ "example": "Redis++", "toolchain": "vs-16-2019-win64-sdk-10-0-18362-0-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" }, | ||
{ "example": "Redis++", "toolchain": "mingw-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" }, | ||
{ "example": "Redis++", "toolchain": "msys-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" } | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# !!! DO NOT PLACE HEADER GUARDS HERE !!! | ||
|
||
include(hunter_add_version) | ||
include(hunter_cacheable) | ||
include(hunter_cmake_args) | ||
include(hunter_download) | ||
include(hunter_pick_scheme) | ||
|
||
hunter_add_version( | ||
PACKAGE_NAME | ||
Redis++ | ||
VERSION | ||
1.3.6 | ||
URL | ||
"https://github.com/sewenew/redis-plus-plus/archive/refs/tags/1.3.6.tar.gz" | ||
SHA1 | ||
650a9fc65c958119f5360ae7dc2341487a29ac6d | ||
) | ||
|
||
hunter_pick_scheme(DEFAULT url_sha1_cmake) | ||
|
||
hunter_cmake_args(Redis++ CMAKE_ARGS REDIS_PLUS_PLUS_BUILD_ASYNC=libuv | ||
REDIS_PLUS_PLUS_BUILD_TEST=OFF CMAKE_PREFIX_PATH=${HUNTER_INSTALL_PREFIX}) | ||
|
||
hunter_cacheable(Redis++) | ||
hunter_download(PACKAGE_NAME Redis++) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.. spelling:: | ||
|
||
HiRedis | ||
hiredis | ||
|
||
.. index:: HiRedis | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please add the package to at least one of the already listed index-groups |
||
|
||
.. _pkg.HiRedis: | ||
|
||
HiRedis | ||
======= | ||
|
||
- `Official <https://github.com/redis/hiredis/>`__ | ||
- `Example | ||
CMakeLists.txt <https://github.com/cpp-pm/hunter/blob/master/examples/HiRedis/CMakeLists.txt>`__ | ||
- Added by `Ronny Nowak <https://github.com/Dargun>`__ | ||
|
||
.. code-block:: cmake | ||
|
||
hunter_add_package(HiRedis) | ||
find_package(HiRedis CONFIG REQUIRED) | ||
target_link_libraries(... hiredis::hiredis_static) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.. spelling:: | ||
|
||
Redis++ | ||
redis | ||
|
||
.. index:: Redis++ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please add the package to at least one of the already listed index-groups |
||
|
||
.. _pkg.Redis++: | ||
|
||
Redis++ | ||
======= | ||
|
||
- `Official <https://github.com/sewenew/redis-plus-plus/>`__ | ||
- `Example | ||
CMakeLists.txt <https://github.com/cpp-pm/hunter/blob/master/examples/Redis++/CMakeLists.txt>`__ | ||
- Added by `Ronny Nowak <https://github.com/Dargun>`__ | ||
|
||
.. code-block:: cmake | ||
|
||
hunter_add_package(HiRedis) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is it really needed to add and find the packages to build and use redis++? The dependencies should be found by Redis++ itself There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no redis++ is not managing that so we need to install libuv and hiredis first and then we can tell rediss++ |
||
find_package(HiRedis CONFIG REQUIRED) | ||
|
||
hunter_add_package(libuv) | ||
find_package(libuv CONFIG REQUIRED) | ||
|
||
hunter_add_package(Redis++) | ||
find_package(Redis++ CONFIG REQUIRED) | ||
|
||
target_link_libraries(... redis++::redis++_static uv) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ libuv | |
|
||
hunter_add_package(libuv) | ||
find_package(libuv CONFIG REQUIRED) | ||
target_link_libraries(... libuv::uv) | ||
target_link_libraries(... uv) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. where did the imported namespace go? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yea offical libuv repro is not defining namespace libuv:: but the hunter repro was doing it. |
||
|
||
uv_ssize_t | ||
~~~~~~~~~~ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (c) 2022, Ronny Nowak | ||
# All rights reserved. | ||
|
||
cmake_minimum_required(VERSION 3.0) | ||
|
||
# Emulate HunterGate: | ||
# * https://github.com/hunter-packages/gate | ||
include("../common.cmake") | ||
|
||
project(download-hiredis) | ||
|
||
# DOCUMENTATION_START { | ||
hunter_add_package(HiRedis) | ||
find_package(HiRedis CONFIG REQUIRED) | ||
Dargun marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
add_executable(example main.cpp) | ||
target_link_libraries(example PUBLIC hiredis::hiredis_static) | ||
# DOCUMENTATION_END } | ||
|
||
# Test double library creation | ||
find_package(HiRedis CONFIG REQUIRED) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include <hiredis/hiredis.h> | ||
|
||
int main(int argc, char** argv) { | ||
redisContext *c = nullptr; | ||
redisReply *reply = nullptr; | ||
redisOptions options = { 0 }; | ||
REDIS_OPTIONS_SET_TCP(&options, "127.0.0.1", 6379); | ||
return 0; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright (c) 2022, Ronny Nowak | ||
# All rights reserved. | ||
|
||
cmake_minimum_required(VERSION 3.0) | ||
|
||
# Emulate HunterGate: | ||
# * https://github.com/hunter-packages/gate | ||
include("../common.cmake") | ||
|
||
project(download-redis++) | ||
|
||
# DOCUMENTATION_START { | ||
hunter_add_package(HiRedis) | ||
find_package(HiRedis CONFIG REQUIRED) | ||
|
||
hunter_add_package(libuv) | ||
find_package(libuv CONFIG REQUIRED) | ||
|
||
hunter_add_package(Redis++) | ||
find_package(Redis++ CONFIG REQUIRED) | ||
|
||
add_executable(example main.cpp) | ||
target_link_libraries(example PUBLIC redis++::redis++_static uv) | ||
# DOCUMENTATION_END } | ||
|
||
# Test double library creation | ||
find_package(Redis++ CONFIG REQUIRED) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include <sw/redis++/redis++.h> | ||
#include <sw/redis++/async_redis++.h> | ||
|
||
using namespace sw::redis; | ||
|
||
int main(int argc, char** argv) { | ||
{ | ||
auto r = Redis("tcp://127.0.0.1"); | ||
auto v = r.command<std::unordered_map<std::string, std::string>>("config", "get", "*"); | ||
} | ||
{ | ||
ConnectionOptions opts; | ||
opts.host = "127.0.0.1"; | ||
opts.port = 6379; | ||
ConnectionPoolOptions pool_opts; | ||
pool_opts.size = 3; | ||
auto async_redis = AsyncRedis(opts, pool_opts); | ||
} | ||
return 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needed? if not please remove