From bd8cb525559b28582b7a890636562bc0afdbbd39 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Fri, 5 Mar 2021 13:25:56 +0800 Subject: [PATCH] make compact as a plugin interface --- src/tsdb/CMakeLists.txt | 4 ++++ src/tsdb/src/tsdbCompact.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/tsdb/CMakeLists.txt b/src/tsdb/CMakeLists.txt index 31d52aae7d..8080a61a6c 100644 --- a/src/tsdb/CMakeLists.txt +++ b/src/tsdb/CMakeLists.txt @@ -6,6 +6,10 @@ AUX_SOURCE_DIRECTORY(src SRC) ADD_LIBRARY(tsdb ${SRC}) TARGET_LINK_LIBRARIES(tsdb tfs common tutil) +IF (TD_TSDB_PLUGINS) + TARGET_LINK_LIBRARIES(tsdb tsdbPlugins) +ENDIF () + IF (TD_LINUX) # Someone has no gtest directory, so comment it # ADD_SUBDIRECTORY(tests) diff --git a/src/tsdb/src/tsdbCompact.c b/src/tsdb/src/tsdbCompact.c index d8cd558424..635bba388a 100644 --- a/src/tsdb/src/tsdbCompact.c +++ b/src/tsdb/src/tsdbCompact.c @@ -14,5 +14,9 @@ */ #include "tsdb.h" +#ifndef _TSDB_PLUGINS + int tsdbCompact(STsdbRepo *pRepo) { return 0; } -void *tsdbCompactImpl(STsdbRepo *pRepo) { return NULL; } \ No newline at end of file +void *tsdbCompactImpl(STsdbRepo *pRepo) { return NULL; } + +#endif \ No newline at end of file -- GitLab