Skip to content

Commit

Permalink
First steps with cmake support.
Browse files Browse the repository at this point in the history
  • Loading branch information
mzimbres committed Aug 20, 2022
1 parent b7abe20 commit 24a215d
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 13 deletions.
14 changes: 8 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,29 @@

## master

* Adds experimental cmake support for windows users.

* Adds new class `sync` that wraps a `connection` and offers a
thread-safe synchronous API. All free functions from the `sync.hpp`
are now member functions of the `sync` class.

* Split `connection::async_receive_event` in two functions, one to
receive events and other for server side pushes.
receive events and another for server side pushes.

* Removes collision between `aedis::adapter::adapt` and
`aedis::adapt`.

* Adds `connection::operation` enum to replace `cancel_*` member
functions with a single cancel function that gets what should be
cancelled as argument.

* Bugfix: Documentation of `adapt()` functions were missing from
doxygen.
functions with a single cancel function that gets the operations
that should be cancelled as argument.

* Bugfix: a bug on reconnect from a state where the `connection` object
had unsent commands. It could cause `async_exec` to never
complete under certain conditions.

* Bugfix: Documentation of `adapt()` functions were missing from
doxygen.

## v0.3.0

* Adds `experimental::exec` and `receive_event` functions to offer a
Expand Down
52 changes: 50 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,50 @@
# This is ongoing work. At the moment autotools is still the supported
# build system.
# At the moment the official build system is still autotools and this
# file is meant to support Aedis on windows.

cmake_minimum_required(VERSION 3.14)

project(
Aedis
VERSION 0.3.0
DESCRIPTION "An async redis client designed for performance and scalability"
HOMEPAGE_URL "https://mzimbres.github.io/aedis"
LANGUAGES CXX
)

add_library(aedis INTERFACE)
target_include_directories(aedis INTERFACE include)

find_package(Boost 1.79 REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})

enable_testing()
include_directories(include)

add_executable(chat_room examples/chat_room.cpp)
add_executable(containers examples/containers.cpp)
add_executable(echo_server examples/echo_server.cpp)
add_executable(intro examples/intro.cpp)
add_executable(intro_sync examples/intro_sync.cpp)
add_executable(serialization examples/serialization.cpp)
add_executable(subscriber examples/subscriber.cpp)
add_executable(subscriber_sync examples/subscriber_sync.cpp)
add_executable(test_low_level tests/low_level.cpp)
add_executable(test_connection tests/connection.cpp)
add_executable(low_level_sync tests/low_level_sync.cpp)

add_test(containers containers)
add_test(intro intro)
add_test(intro_sync intro_sync)
add_test(serialization serialization)
add_test(test_low_level test_low_level)
add_test(test_connection test_connection)
add_test(low_level_sync low_level_sync)

include(GNUInstallDirs)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/boost
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING
PATTERN "*.hpp"
PATTERN "*.ipp"
)

2 changes: 2 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ EXTRA_DIST += $(top_srcdir)/benchmarks/rust/echo_server_direct/Cargo.toml
EXTRA_DIST += $(top_srcdir)/benchmarks/rust/echo_server_direct/src/main.rs
EXTRA_DIST += $(top_srcdir)/benchmarks/rust/echo_server_over_redis/Cargo.toml
EXTRA_DIST += $(top_srcdir)/benchmarks/rust/echo_server_over_redis/src/main.rs
EXTRA_DIST += $(top_srcdir)/CMakeLists.txt

.PHONY: doc
doc:
Expand All @@ -92,3 +93,4 @@ coverage:
bench:
pdflatex --jobname=echo-f0 benchmarks/benchmarks.tex
pdflatex --jobname=echo-f1 benchmarks/benchmarks.tex

1 change: 1 addition & 0 deletions include/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ nobase_include_HEADERS =\
$(top_srcdir)/include/aedis/detail/net.hpp\
$(top_srcdir)/include/aedis/connection.hpp\
$(top_srcdir)/include/aedis/adapt.hpp\
$(top_srcdir)/include/aedis/sync.hpp\
$(top_srcdir)/include/aedis/detail/connection_ops.hpp\
$(top_srcdir)/include/aedis.hpp\
$(top_srcdir)/include/aedis/adapter/detail/adapters.hpp\
Expand Down
18 changes: 13 additions & 5 deletions include/aedis.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@
$ make
```
There is also experimental support cmake, for example
@code
$ BOOST_ROOT=/opt/boost_1_79_0/ cmake -DCMAKE_CXX_FLAGS=-std=c++20 .
@endcode
@subsubsection using_aedis Using Aedis
When writing you own applications include the following header
Expand Down Expand Up @@ -204,12 +210,15 @@
$ autoreconf -i
```
After that you will have a configure script that you can run as
explained above, for example, to use a compiler other that the
system compiler run
After that we get a configure script that can be run as explained
above, for example, to build with a compiler other that the system
compiler with coverage support run
```
$ CXX=clang++-14 CXXFLAGS="-g" ./configure --with-boost=...
$ CXX=clang++-14 \
CXXFLAGS="-g -std=c++20 -Wall -Wextra --coverage -fkeep-inline-functions -fkeep-static-functions" \
LDFLAGS="--coverage" \
./configure --with-boost=/opt/boost_1_79_0
```
To generate release tarballs run
Expand All @@ -218,7 +227,6 @@
$ make distcheck
```
\section requests Requests
Redis requests are composed of one of more Redis commands (in
Expand Down

0 comments on commit 24a215d

Please sign in to comment.