[tarantool-patches] [PATCH v2 2/4] Move 'http_parser' to src/lib
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Tue Feb 26 15:11:34 MSK 2019
Http_parser in fact does not depend on anything, even on the core.
As a rule, such basic libraries are stored in src/lib.
The patch is not necessary for anything, but it is a right thing
to do, while some activity is happening there.
---
src/CMakeLists.txt | 3 +--
src/lib/CMakeLists.txt | 1 +
src/lib/http_parser/CMakeLists.txt | 1 +
src/{ => lib/http_parser}/http_parser.c | 0
src/{ => lib/http_parser}/http_parser.h | 0
src/lua/httpc.c | 2 +-
6 files changed, 4 insertions(+), 3 deletions(-)
create mode 100644 src/lib/http_parser/CMakeLists.txt
rename src/{ => lib/http_parser}/http_parser.c (100%)
rename src/{ => lib/http_parser}/http_parser.h (100%)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 1abde73b3..3d8d6413c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -100,7 +100,6 @@ set (core_sources
util.c
random.c
trigger.cc
- http_parser.c
coll.c
coll_def.c
mpstream.c
@@ -219,7 +218,7 @@ endif()
set_source_files_compile_flags(${server_sources})
add_library(server STATIC ${server_sources})
-target_link_libraries(server core bit uri uuid ${ICU_LIBRARIES})
+target_link_libraries(server core http_parser bit uri uuid ${ICU_LIBRARIES})
# Rule of thumb: if exporting a symbol from a static library, list the
# library here.
diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
index e06934486..e06d35bf0 100644
--- a/src/lib/CMakeLists.txt
+++ b/src/lib/CMakeLists.txt
@@ -6,6 +6,7 @@ add_subdirectory(salad)
add_subdirectory(csv)
add_subdirectory(json)
add_subdirectory(uri)
+add_subdirectory(http_parser)
if(ENABLE_BUNDLED_MSGPUCK)
add_subdirectory(msgpuck EXCLUDE_FROM_ALL)
endif()
diff --git a/src/lib/http_parser/CMakeLists.txt b/src/lib/http_parser/CMakeLists.txt
new file mode 100644
index 000000000..a48f83cb6
--- /dev/null
+++ b/src/lib/http_parser/CMakeLists.txt
@@ -0,0 +1 @@
+add_library(http_parser STATIC http_parser.c)
diff --git a/src/http_parser.c b/src/lib/http_parser/http_parser.c
similarity index 100%
rename from src/http_parser.c
rename to src/lib/http_parser/http_parser.c
diff --git a/src/http_parser.h b/src/lib/http_parser/http_parser.h
similarity index 100%
rename from src/http_parser.h
rename to src/lib/http_parser/http_parser.h
diff --git a/src/lua/httpc.c b/src/lua/httpc.c
index d31e664d6..976b2d4cf 100644
--- a/src/lua/httpc.c
+++ b/src/lua/httpc.c
@@ -34,7 +34,7 @@
*/
#define DRIVER_LUA_UDATA_NAME "httpc"
-#include <http_parser.h>
+#include "http_parser/http_parser.h"
#include "src/httpc.h"
#include "say.h"
#include "lua/utils.h"
--
2.17.2 (Apple Git-113)
More information about the Tarantool-patches
mailing list