Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: tarantool-patches@freelists.org
Cc: vdavydov.dev@gmail.com
Subject: [PATCH 1/2] Move 'uri' lib to src/lib/
Date: Mon, 25 Feb 2019 23:56:46 +0300	[thread overview]
Message-ID: <ef539a796440523b4e50ba58972d3f7f0ef66e63.1551127892.git.v.shpilevoy@tarantool.org> (raw)
In-Reply-To: <cover.1551127892.git.v.shpilevoy@tarantool.org>
In-Reply-To: <cover.1551127892.git.v.shpilevoy@tarantool.org>

URI and core libraries are going to be used by SWIM, stored in
src/lib. But src/lib can not depend on src/. This patch pushes
core library down to src/lib - the lowest level of source
dependencies.

Needed for #3234
---
 src/CMakeLists.txt         | 11 -----------
 src/box/applier.h          |  2 +-
 src/evio.c                 |  1 -
 src/evio.h                 |  2 +-
 src/lib/CMakeLists.txt     |  1 +
 src/lib/uri/CMakeLists.txt | 10 ++++++++++
 src/{ => lib/uri}/uri.c    |  0
 src/{ => lib/uri}/uri.h    |  0
 src/{ => lib/uri}/uri.rl   |  0
 src/sio.c                  |  2 +-
 test/unit/uri.c            |  2 +-
 11 files changed, 15 insertions(+), 16 deletions(-)
 create mode 100644 src/lib/uri/CMakeLists.txt
 rename src/{ => lib/uri}/uri.c (100%)
 rename src/{ => lib/uri}/uri.h (100%)
 rename src/{ => lib/uri}/uri.rl (100%)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0a8fabae6..1abde73b3 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -64,10 +64,6 @@ add_custom_target(generate_lua_sources
     DEPENDS ${lua_sources})
 set_property(DIRECTORY PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${lua_sources})
 
-add_custom_target(ragel
-    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
-    COMMAND ragel -G2 src/uri.rl -o src/uri.c)
-
 # There is no libdl.so on FreeBSD prior to 11.2.
 #
 # Always links pthread and dl dynamically.
@@ -134,13 +130,6 @@ if (ENABLE_BACKTRACE AND NOT TARGET_OS_DARWIN)
     target_link_libraries(core gcc_s ${UNWIND_LIBRARIES})
 endif()
 
-if (CC_HAS_WNO_IMPLICIT_FALLTHROUGH)
-    # Suppress noise warnings for autogenerated Ragel code
-    set_source_files_properties(uri.c PROPERTIES COMPILE_FLAGS
-        -Wno-implicit-fallthrough)
-endif()
-add_library(uri STATIC uri.c)
-
 add_library(uuid STATIC tt_uuid.c)
 target_link_libraries(uuid core bit)
 
diff --git a/src/box/applier.h b/src/box/applier.h
index 5a9c40fc8..25a795fe5 100644
--- a/src/box/applier.h
+++ b/src/box/applier.h
@@ -41,7 +41,7 @@
 #include "trigger.h"
 #include "trivia/util.h"
 #include "tt_uuid.h"
-#include "uri.h"
+#include "uri/uri.h"
 
 #include "xrow.h"
 
diff --git a/src/evio.c b/src/evio.c
index 8610dbbe7..2152c15e6 100644
--- a/src/evio.c
+++ b/src/evio.c
@@ -29,7 +29,6 @@
  * SUCH DAMAGE.
  */
 #include "evio.h"
-#include "uri.h"
 #include <stdio.h>
 #include <sys/socket.h>
 #include <sys/un.h>
diff --git a/src/evio.h b/src/evio.h
index 872a21ab6..fc7e19989 100644
--- a/src/evio.h
+++ b/src/evio.h
@@ -37,7 +37,7 @@
 #include <stdbool.h>
 #include "tarantool_ev.h"
 #include "sio.h"
-#include "uri.h"
+#include "uri/uri.h"
 
 #if defined(__cplusplus)
 extern "C" {
diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
index 98ff19b60..e06934486 100644
--- a/src/lib/CMakeLists.txt
+++ b/src/lib/CMakeLists.txt
@@ -5,6 +5,7 @@ add_subdirectory(small)
 add_subdirectory(salad)
 add_subdirectory(csv)
 add_subdirectory(json)
+add_subdirectory(uri)
 if(ENABLE_BUNDLED_MSGPUCK)
     add_subdirectory(msgpuck EXCLUDE_FROM_ALL)
 endif()
diff --git a/src/lib/uri/CMakeLists.txt b/src/lib/uri/CMakeLists.txt
new file mode 100644
index 000000000..f0913b7b4
--- /dev/null
+++ b/src/lib/uri/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_custom_target(ragel
+    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+    COMMAND ragel -G2 src/uri.rl -o src/uri.c)
+
+if (CC_HAS_WNO_IMPLICIT_FALLTHROUGH)
+    # Suppress noise warnings for autogenerated Ragel code
+    set_source_files_properties(uri.c PROPERTIES COMPILE_FLAGS
+        -Wno-implicit-fallthrough)
+endif()
+add_library(uri STATIC uri.c)
diff --git a/src/uri.c b/src/lib/uri/uri.c
similarity index 100%
rename from src/uri.c
rename to src/lib/uri/uri.c
diff --git a/src/uri.h b/src/lib/uri/uri.h
similarity index 100%
rename from src/uri.h
rename to src/lib/uri/uri.h
diff --git a/src/uri.rl b/src/lib/uri/uri.rl
similarity index 100%
rename from src/uri.rl
rename to src/lib/uri/uri.rl
diff --git a/src/sio.c b/src/sio.c
index 419f4e0f4..7ea13f736 100644
--- a/src/sio.c
+++ b/src/sio.c
@@ -40,7 +40,7 @@
 #include "say.h"
 #include "trivia/util.h"
 #include "exception.h"
-#include "uri.h"
+#include "uri/uri.h"
 
 const char *
 sio_socketname(int fd)
diff --git a/test/unit/uri.c b/test/unit/uri.c
index b69f92726..a10f61e2e 100644
--- a/test/unit/uri.c
+++ b/test/unit/uri.c
@@ -1,5 +1,5 @@
 #include "unit.h"
-#include <uri.h>
+#include "uri/uri.h"
 #include <string.h>
 
 int
-- 
2.17.2 (Apple Git-113)

  reply	other threads:[~2019-02-25 20:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-25 20:56 [PATCH 0/2] Move 'core' lib to src/lib Vladislav Shpilevoy
2019-02-25 20:56 ` Vladislav Shpilevoy [this message]
2019-02-26  8:27   ` [tarantool-patches] [PATCH 1/2] Move 'uri' lib to src/lib/ Konstantin Osipov
2019-02-26 12:07     ` [tarantool-patches] " Vladislav Shpilevoy
2019-02-25 20:56 ` [PATCH 2/2] Move 'core' and 'uuid' libs to src/lib Vladislav Shpilevoy
2019-02-26  8:30   ` [tarantool-patches] " Konstantin Osipov
2019-02-26  9:38     ` [tarantool-patches] " Vladislav Shpilevoy
2019-02-26 10:27       ` Konstantin Osipov
2019-02-26 12:11         ` Vladislav Shpilevoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ef539a796440523b4e50ba58972d3f7f0ef66e63.1551127892.git.v.shpilevoy@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [PATCH 1/2] Move '\''uri'\'' lib to src/lib/' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox