CMakeLists.txt 1.4 KB
Newer Older
H
Hongze Cheng 已提交
1
set(META_DB_IMPL_LIST "BDB" "TDB")
H
Hongze Cheng 已提交
2
set(META_DB_IMPL "BDB" CACHE STRING "Use BDB as the default META implementation")
H
Hongze Cheng 已提交
3 4 5 6 7 8 9 10
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()

H
Hongze Cheng 已提交
11
aux_source_directory(src/meta META_SRC)
H
Hongze Cheng 已提交
12 13 14 15 16 17
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()

H
Hongze Cheng 已提交
18 19 20
aux_source_directory(src/tq TQ_SRC)
aux_source_directory(src/tsdb TSDB_SRC)
aux_source_directory(src/vnd VND_SRC)
H
Hongze Cheng 已提交
21

H
Hongze Cheng 已提交
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
list(APPEND
    VNODE_SRC
    ${META_SRC}
    ${TQ_SRC}
    ${TSDB_SRC}
    ${VND_SRC}
)

add_library(vnode STATIC ${VNODE_SRC})
target_include_directories(
    vnode
    PUBLIC inc
    PRIVATE src/inc
)
target_link_libraries(
    vnode
    PUBLIC os
    PUBLIC util
    PUBLIC common
    PUBLIC transport
    PUBLIC tfs
    PUBLIC wal
L
Liu Jicong 已提交
44
    PUBLIC scheduler
45
    PUBLIC executor
H
Hongze Cheng 已提交
46
    PUBLIC qworker
S
Shengliang Guan 已提交
47
    PUBLIC sync
H
Hongze Cheng 已提交
48 49
)

H
Hongze Cheng 已提交
50 51 52 53 54 55
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()

H
Hongze Cheng 已提交
56
if(${BUILD_TEST})
C
Cary Xu 已提交
57
    add_subdirectory(test)
H
Hongze Cheng 已提交
58
endif(${BUILD_TEST})