From 68efeac90985cddc539fc70e7a20617281f7ccdc Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Mon, 22 Aug 2022 20:54:48 +0200 Subject: [PATCH] [dbi]: move all mongo related files into subdirectory --- lib/dbi/meson.build | 22 ++++++++++++++-------- lib/dbi/{ => mongo}/ims.c | 0 lib/dbi/{ => mongo}/ogs-mongoc.c | 0 lib/dbi/{ => mongo}/ogs-mongoc.h | 0 lib/dbi/{ => mongo}/session.c | 0 lib/dbi/{ => mongo}/subscription.c | 0 lib/dbi/ogs-dbi.h | 2 +- 7 files changed, 15 insertions(+), 9 deletions(-) rename lib/dbi/{ => mongo}/ims.c (100%) rename lib/dbi/{ => mongo}/ogs-mongoc.c (100%) rename lib/dbi/{ => mongo}/ogs-mongoc.h (100%) rename lib/dbi/{ => mongo}/session.c (100%) rename lib/dbi/{ => mongo}/subscription.c (100%) diff --git a/lib/dbi/meson.build b/lib/dbi/meson.build index a48f47785..c0aa380e0 100644 --- a/lib/dbi/meson.build +++ b/lib/dbi/meson.build @@ -15,18 +15,24 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -libdbi_sources = files(''' + +dbi_sources = files(''' ogs-dbi.h +'''.split()) +libdbi_sources = [dbi_sources] - ogs-mongoc.h - - ogs-mongoc.c - subscription.c - session.c - ims.c +mongo_sources = files(''' + mongo/ogs-mongoc.h + mongo/ogs-mongoc.c + mongo/subscription.c + mongo/session.c + mongo/ims.c '''.split()) -libmongoc_dep = dependency('libmongoc-1.0') +libmongoc_dep = dependency('libmongoc-1.0', required: true) +if libmongoc_dep.found() + libdbi_sources += [mongo_sources] +endif libdbi_inc = include_directories('.') diff --git a/lib/dbi/ims.c b/lib/dbi/mongo/ims.c similarity index 100% rename from lib/dbi/ims.c rename to lib/dbi/mongo/ims.c diff --git a/lib/dbi/ogs-mongoc.c b/lib/dbi/mongo/ogs-mongoc.c similarity index 100% rename from lib/dbi/ogs-mongoc.c rename to lib/dbi/mongo/ogs-mongoc.c diff --git a/lib/dbi/ogs-mongoc.h b/lib/dbi/mongo/ogs-mongoc.h similarity index 100% rename from lib/dbi/ogs-mongoc.h rename to lib/dbi/mongo/ogs-mongoc.h diff --git a/lib/dbi/session.c b/lib/dbi/mongo/session.c similarity index 100% rename from lib/dbi/session.c rename to lib/dbi/mongo/session.c diff --git a/lib/dbi/subscription.c b/lib/dbi/mongo/subscription.c similarity index 100% rename from lib/dbi/subscription.c rename to lib/dbi/mongo/subscription.c diff --git a/lib/dbi/ogs-dbi.h b/lib/dbi/ogs-dbi.h index 67bc0c1e0..4eec01a9d 100644 --- a/lib/dbi/ogs-dbi.h +++ b/lib/dbi/ogs-dbi.h @@ -25,7 +25,7 @@ #define OGS_DBI_INSIDE /* TODO: remove ogs-mongoc.h as soon the test cases don't depend on it */ -#include "dbi/ogs-mongoc.h" +#include "dbi/mongo/ogs-mongoc.h" #include "dbi/subscription.h" #include "dbi/session.h"