From 6537047156f38d497f9794dad88ebae52f4e874d Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Thu, 11 Aug 2022 16:16:52 +0800 Subject: [PATCH 1/2] fix: make grant compile correct --- source/common/CMakeLists.txt | 4 ++++ source/dnode/mnode/impl/CMakeLists.txt | 1 + source/dnode/vnode/CMakeLists.txt | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/source/common/CMakeLists.txt b/source/common/CMakeLists.txt index 2b5d440a73..1c11ee7085 100644 --- a/source/common/CMakeLists.txt +++ b/source/common/CMakeLists.txt @@ -5,6 +5,10 @@ if (DEFINED GRANT_CFG_INCLUDE_DIR) add_definitions(-DGRANTS_CFG) endif() +IF (TD_GRANT) + ADD_DEFINITIONS(-D_GRANT) +ENDIF () + target_include_directories( common PUBLIC "${TD_SOURCE_DIR}/include/common" diff --git a/source/dnode/mnode/impl/CMakeLists.txt b/source/dnode/mnode/impl/CMakeLists.txt index c740ea1397..25a4397b7d 100644 --- a/source/dnode/mnode/impl/CMakeLists.txt +++ b/source/dnode/mnode/impl/CMakeLists.txt @@ -15,6 +15,7 @@ target_include_directories( target_link_libraries( mnode scheduler sdb wal transport cjson sync monitor executor qworker stream parser ) + IF (TD_GRANT) TARGET_LINK_LIBRARIES(mnode grant) ADD_DEFINITIONS(-D_GRANT) diff --git a/source/dnode/vnode/CMakeLists.txt b/source/dnode/vnode/CMakeLists.txt index cb9f3d9809..b218d982e9 100644 --- a/source/dnode/vnode/CMakeLists.txt +++ b/source/dnode/vnode/CMakeLists.txt @@ -86,6 +86,11 @@ target_link_libraries( PUBLIC stream PUBLIC index ) + +IF (TD_GRANT) + TARGET_LINK_LIBRARIES(vnode PUBLIC grant) +ENDIF () + target_compile_definitions(vnode PUBLIC -DMETA_REFACT) if(${BUILD_WITH_INVERTEDINDEX}) From a7a334b5b09f76e63cd1cafbb9e863f738358ed4 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Thu, 11 Aug 2022 18:06:22 +0800 Subject: [PATCH 2/2] fix: multiple defination --- source/dnode/mnode/impl/src/mndDb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndDb.c b/source/dnode/mnode/impl/src/mndDb.c index 9dde083f50..853ace79fd 100644 --- a/source/dnode/mnode/impl/src/mndDb.c +++ b/source/dnode/mnode/impl/src/mndDb.c @@ -1419,7 +1419,7 @@ const char *mndGetDbStr(const char *src) { return pos; } -int64_t getValOfDiffPrecision(int8_t unit, int64_t val) { +static int64_t getValOfDiffPrecision(int8_t unit, int64_t val) { int64_t v = 0; switch (unit) { case 's': @@ -1444,7 +1444,7 @@ int64_t getValOfDiffPrecision(int8_t unit, int64_t val) { return v; } -char *buildRetension(SArray *pRetension) { +static char *buildRetension(SArray *pRetension) { size_t size = taosArrayGetSize(pRetension); if (size == 0) { return NULL;