Skip to content

Commit 24a215d

Browse files
committed
First steps with cmake support.
1 parent b7abe20 commit 24a215d

File tree

5 files changed

+74
-13
lines changed

5 files changed

+74
-13
lines changed

CHANGELOG.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,29 @@
22

33
## master
44

5+
* Adds experimental cmake support for windows users.
6+
57
* Adds new class `sync` that wraps a `connection` and offers a
68
thread-safe synchronous API. All free functions from the `sync.hpp`
79
are now member functions of the `sync` class.
810

911
* Split `connection::async_receive_event` in two functions, one to
10-
receive events and other for server side pushes.
12+
receive events and another for server side pushes.
1113

1214
* Removes collision between `aedis::adapter::adapt` and
1315
`aedis::adapt`.
1416

1517
* Adds `connection::operation` enum to replace `cancel_*` member
16-
functions with a single cancel function that gets what should be
17-
cancelled as argument.
18-
19-
* Bugfix: Documentation of `adapt()` functions were missing from
20-
doxygen.
18+
functions with a single cancel function that gets the operations
19+
that should be cancelled as argument.
2120

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

25+
* Bugfix: Documentation of `adapt()` functions were missing from
26+
doxygen.
27+
2628
## v0.3.0
2729

2830
* Adds `experimental::exec` and `receive_event` functions to offer a

CMakeLists.txt

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,50 @@
1-
# This is ongoing work. At the moment autotools is still the supported
2-
# build system.
1+
# At the moment the official build system is still autotools and this
2+
# file is meant to support Aedis on windows.
3+
4+
cmake_minimum_required(VERSION 3.14)
5+
6+
project(
7+
Aedis
8+
VERSION 0.3.0
9+
DESCRIPTION "An async redis client designed for performance and scalability"
10+
HOMEPAGE_URL "https://mzimbres.github.io/aedis"
11+
LANGUAGES CXX
12+
)
13+
14+
add_library(aedis INTERFACE)
15+
target_include_directories(aedis INTERFACE include)
16+
17+
find_package(Boost 1.79 REQUIRED)
18+
include_directories(${Boost_INCLUDE_DIRS})
19+
20+
enable_testing()
21+
include_directories(include)
22+
23+
add_executable(chat_room examples/chat_room.cpp)
24+
add_executable(containers examples/containers.cpp)
25+
add_executable(echo_server examples/echo_server.cpp)
26+
add_executable(intro examples/intro.cpp)
27+
add_executable(intro_sync examples/intro_sync.cpp)
28+
add_executable(serialization examples/serialization.cpp)
29+
add_executable(subscriber examples/subscriber.cpp)
30+
add_executable(subscriber_sync examples/subscriber_sync.cpp)
31+
add_executable(test_low_level tests/low_level.cpp)
32+
add_executable(test_connection tests/connection.cpp)
33+
add_executable(low_level_sync tests/low_level_sync.cpp)
34+
35+
add_test(containers containers)
36+
add_test(intro intro)
37+
add_test(intro_sync intro_sync)
38+
add_test(serialization serialization)
39+
add_test(test_low_level test_low_level)
40+
add_test(test_connection test_connection)
41+
add_test(low_level_sync low_level_sync)
42+
43+
include(GNUInstallDirs)
44+
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/boost
45+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
46+
FILES_MATCHING
47+
PATTERN "*.hpp"
48+
PATTERN "*.ipp"
49+
)
50+

Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ EXTRA_DIST += $(top_srcdir)/benchmarks/rust/echo_server_direct/Cargo.toml
7777
EXTRA_DIST += $(top_srcdir)/benchmarks/rust/echo_server_direct/src/main.rs
7878
EXTRA_DIST += $(top_srcdir)/benchmarks/rust/echo_server_over_redis/Cargo.toml
7979
EXTRA_DIST += $(top_srcdir)/benchmarks/rust/echo_server_over_redis/src/main.rs
80+
EXTRA_DIST += $(top_srcdir)/CMakeLists.txt
8081

8182
.PHONY: doc
8283
doc:
@@ -92,3 +93,4 @@ coverage:
9293
bench:
9394
pdflatex --jobname=echo-f0 benchmarks/benchmarks.tex
9495
pdflatex --jobname=echo-f1 benchmarks/benchmarks.tex
96+

include/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ nobase_include_HEADERS =\
66
$(top_srcdir)/include/aedis/detail/net.hpp\
77
$(top_srcdir)/include/aedis/connection.hpp\
88
$(top_srcdir)/include/aedis/adapt.hpp\
9+
$(top_srcdir)/include/aedis/sync.hpp\
910
$(top_srcdir)/include/aedis/detail/connection_ops.hpp\
1011
$(top_srcdir)/include/aedis.hpp\
1112
$(top_srcdir)/include/aedis/adapter/detail/adapters.hpp\

include/aedis.hpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,12 @@
177177
$ make
178178
```
179179
180+
There is also experimental support cmake, for example
181+
182+
@code
183+
$ BOOST_ROOT=/opt/boost_1_79_0/ cmake -DCMAKE_CXX_FLAGS=-std=c++20 .
184+
@endcode
185+
180186
@subsubsection using_aedis Using Aedis
181187
182188
When writing you own applications include the following header
@@ -204,12 +210,15 @@
204210
$ autoreconf -i
205211
```
206212
207-
After that you will have a configure script that you can run as
208-
explained above, for example, to use a compiler other that the
209-
system compiler run
213+
After that we get a configure script that can be run as explained
214+
above, for example, to build with a compiler other that the system
215+
compiler with coverage support run
210216
211217
```
212-
$ CXX=clang++-14 CXXFLAGS="-g" ./configure --with-boost=...
218+
$ CXX=clang++-14 \
219+
CXXFLAGS="-g -std=c++20 -Wall -Wextra --coverage -fkeep-inline-functions -fkeep-static-functions" \
220+
LDFLAGS="--coverage" \
221+
./configure --with-boost=/opt/boost_1_79_0
213222
```
214223
215224
To generate release tarballs run
@@ -218,7 +227,6 @@
218227
$ make distcheck
219228
```
220229
221-
222230
\section requests Requests
223231
224232
Redis requests are composed of one of more Redis commands (in

0 commit comments

Comments
 (0)