File tree Expand file tree Collapse file tree 5 files changed +30
-17
lines changed
Expand file tree Collapse file tree 5 files changed +30
-17
lines changed Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 3.15 )
2- project (http_server VERSION 1.0 LANGUAGES C CXX )
2+ project (http_server_library VERSION 1.0 LANGUAGES C CXX )
3+
4+ add_subdirectory (demo )
35
46set (LIBRARY "server_library" )
57set (TEST_TARGET "server_tests_bin" )
6- set (TARGET "server_impl_bin" )
78set (CMAKE_EXPORT_COMPILE_COMMANDS ON )
89
910# Override Debug flags
@@ -17,7 +18,7 @@ find_package(Threads REQUIRED)
1718
1819
1920# server library
20- add_library (${LIBRARY}
21+ add_library (${LIBRARY} STATIC
2122 src/HttpServer.cpp
2223 src/HttpParser.cpp
2324 src/PathParams.cpp
@@ -47,14 +48,6 @@ include(GoogleTest)
4748gtest_discover_tests (${TEST_TARGET} )
4849
4950
50- # server implementation executable
51- add_executable (${TARGET}
52- src/main.cpp
53- )
54- target_link_options (${TARGET} PRIVATE -O0 -g --coverage )
55- target_link_libraries (${TARGET} PRIVATE ${LIBRARY} )
56-
57-
5851# coverage target
5952# find required tools
6053find_program (LCOV lcov REQUIRED )
Original file line number Diff line number Diff line change @@ -139,8 +139,9 @@ try {
139139.
140140├── src/ # Server implementation
141141├── include/ # Public headers
142- ├── tests/ # gtest-based test suite
143- ├── cmake/ # CMake helpers
142+ ├── test/ # gtest-based test suite
143+ ├── demo/ # demo of the library implementation
144+ ├── benchmarks/ # k6 performance benchmark outputs with a node server comparison
144145├── .github/ # GitHub Actions workflows
145146└── README.md
146147```
@@ -186,16 +187,16 @@ conan build . --build=missing -s build_type=Debug
186187
187188---
188189
189- ## Running the Server
190+ ## Running the Server Demo
190191
191192Command to run the HTTP server implementation example:
192193
193194``` bash
194195# in release mode
195- ./build/Release/server_impl_bin
196+ ./build/Release/demo/server_demo_bin
196197
197198# in debug mode
198- ./build/Debug/server_impl_bin
199+ ./build/Debug/demo/server_demo_bin
199200```
200201
201202---
Original file line number Diff line number Diff line change 1+ cmake_minimum_required (VERSION 3.15 )
2+ project (server_demo VERSION 1.0 LANGUAGES C CXX )
3+
4+ set (LIBRARY "server_library" )
5+ set (TARGET "server_demo_bin" )
6+ set (CMAKE_EXPORT_COMPILE_COMMANDS ON )
7+
8+ # Override Debug flags
9+ set (CMAKE_CXX_FLAGS_DEBUG "-g -O0 --coverage" )
10+ set (CMAKE_C_FLAGS_DEBUG "-g -O0 --coverage" )
11+ set (CMAKE_EXE_LINKER_FLAGS_DEBUG "--coverage" )
12+ set (CMAKE_SHARED_LINKER_FLAGS_DEBUG "--coverage" )
13+
14+
15+ # server implementation executable
16+ add_executable (${TARGET}
17+ main.cpp
18+ )
19+ target_link_libraries (${TARGET} PRIVATE ${LIBRARY} )
File renamed without changes.
Original file line number Diff line number Diff line change 11#include < gtest/gtest.h>
2- #include " ../include/ HttpParser.h"
2+ #include " HttpParser.h"
33
44#include < arpa/inet.h>
55#include < netinet/in.h>
You can’t perform that action at this time.
0 commit comments