Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit 210b423

Browse files
author
hamidr
committed
Removing libevpp from within the project and use it as cmake library
1 parent 8dd752d commit 210b423

File tree

14 files changed

+13
-630
lines changed

14 files changed

+13
-630
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "libs/libevpp"]
2+
path = libs/libevpp
3+
url = https://github.com/hamidr/libevpp

CMakeLists.txt

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,11 @@ include_directories("/usr/local/include")
2828
link_directories("/usr/lib")
2929
link_directories("/usr/local/lib")
3030

31+
add_subdirectory(${CMAKE_SOURCE_DIR}/libs/libevpp/)
3132

32-
add_library(event_loop
33-
${PROJECT_SOURCE_DIR}/event_loop/socket_watcher.cpp
34-
${PROJECT_SOURCE_DIR}/event_loop/event_loop_ev.cpp)
33+
include_directories(${CMAKE_SOURCE_DIR}/libs/libevpp/includes/)
34+
link_directories(${CMAKE_SOURCE_DIR}/libs/libevpp/build/)
3535

36-
add_library(network
37-
${PROJECT_SOURCE_DIR}/network/async_socket.cpp
38-
${PROJECT_SOURCE_DIR}/network/unix_socket.cpp
39-
${PROJECT_SOURCE_DIR}/network/tcp_socket.cpp)
4036

4137
add_library(parser
4238
${PROJECT_SOURCE_DIR}/parser/base_resp_parser.cpp
@@ -59,19 +55,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
5955
set(CMAKE_EXE_LINKER_FLAGS "-s") ## Strip binary
6056
endif()
6157

62-
target_link_libraries(event_loop ev)
63-
target_link_libraries(async_redis event_loop parser network)
58+
target_link_libraries(async_redis network)
6459

65-
install(TARGETS event_loop
66-
LIBRARY DESTINATION /usr/local/lib/
67-
ARCHIVE DESTINATION /usr/local/lib/)
68-
69-
install(TARGETS parser
70-
LIBRARY DESTINATION /usr/local/lib/
71-
ARCHIVE DESTINATION /usr/local/lib/
72-
)
73-
74-
install(DIRECTORY ${PROJECT_INCLUDE_DIR}/ DESTINATION /usr/local/include)
75-
76-
add_executable (a1.out ${CMAKE_SOURCE_DIR}/test/main.cpp)
77-
target_link_libraries(a1.out async_redis)
60+
add_executable (a2.out ${CMAKE_SOURCE_DIR}/test/main.cpp)
61+
target_link_libraries(a2.out async_redis)

includes/connection.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
#include <tuple>
77

88
#include <parser/base_resp_parser.h>
9-
#include <network/async_socket.hpp>
9+
#include <libevpp/event_loop/event_loop_ev.h>
10+
#include <libevpp/network/async_socket.hpp>
1011

1112
namespace async_redis
1213
{
1314
class connection
1415
{
15-
using async_socket = network::async_socket;
16+
using async_socket = libevpp::network::async_socket;
1617

1718
public:
1819
using parser_t = parser::base_resp_parser::parser;

includes/event_loop/event_loop_ev.h

Lines changed: 0 additions & 48 deletions
This file was deleted.

includes/event_loop/socket_watcher.h

Lines changed: 0 additions & 47 deletions
This file was deleted.

includes/network/async_socket.hpp

Lines changed: 0 additions & 75 deletions
This file was deleted.

includes/network/tcp_socket.hpp

Lines changed: 0 additions & 18 deletions
This file was deleted.

includes/network/unix_socket.hpp

Lines changed: 0 additions & 17 deletions
This file was deleted.

libs/libevpp

Submodule libevpp added at 18bc2fc

src/event_loop/event_loop_ev.cpp

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)