From 0a39e8fadb61dc5a5085176003ec9962233e6d4c Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Wed, 9 Feb 2022 11:02:07 +0000 Subject: [PATCH] integrate TDB --- source/dnode/vnode/CMakeLists.txt | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/source/dnode/vnode/CMakeLists.txt b/source/dnode/vnode/CMakeLists.txt index e625c56db1..bd633fa70a 100644 --- a/source/dnode/vnode/CMakeLists.txt +++ b/source/dnode/vnode/CMakeLists.txt @@ -1,7 +1,24 @@ +set(META_DB_IMPL_LIST "BDB" "TDB") +set(META_DB_IMPL "BDB" CACHE STRING "Use BDB as the default META implementation") +set_property(CACHE META_DB_IMPL PROPERTY STRINGS ${META_DB_IMPL_LIST}) + +if(META_DB_IMPL IN_LIST META_DB_IMPL_LIST) + message(STATUS "META DB Impl: ${META_DB_IMPL}==============") +else() + message(FATAL_ERROR "Invalid META DB IMPL: ${META_DB_IMPL}==============") +endif() + aux_source_directory(src/meta META_SRC) +if(${META_DB_IMPL} STREQUAL "BDB") + list(REMOVE_ITEM META_SRC "src/meta/metaTDBImpl.c") +elseif(${META_DB_IMPL} STREQUAL "TDB") + list(REMOVE_ITEM META_SRC "src/meta/metaBDBImpl.c") +endif() + aux_source_directory(src/tq TQ_SRC) aux_source_directory(src/tsdb TSDB_SRC) aux_source_directory(src/vnd VND_SRC) + list(APPEND VNODE_SRC ${META_SRC} @@ -22,7 +39,6 @@ target_link_libraries( PUBLIC util PUBLIC common PUBLIC transport - PUBLIC bdb PUBLIC tfs PUBLIC wal PUBLIC scheduler @@ -30,6 +46,12 @@ target_link_libraries( PUBLIC qworker ) +if(${META_DB_IMPL} STREQUAL "BDB") + target_link_libraries(vnode PUBLIC bdb) +elseif(${META_DB_IMPL} STREQUAL "TDB") + target_link_libraries(vnode PUBLIC tdb) +endif() + if(${BUILD_TEST}) # add_subdirectory(test) endif(${BUILD_TEST}) -- GitLab