CMakeLists.txt 1.8 KB
Newer Older
S
Shengliang Guan 已提交
1 2 3
aux_source_directory(src SHELL_SRC)

add_executable(shell ${SHELL_SRC})
4

5 6 7 8 9 10 11 12
IF (TD_LINUX_64 AND JEMALLOC_ENABLED)
    ADD_DEFINITIONS(-DTD_JEMALLOC_ENABLED -I${CMAKE_BINARY_DIR}/build/include -L${CMAKE_BINARY_DIR}/build/lib -Wl,-rpath,${CMAKE_BINARY_DIR}/build/lib -ljemalloc)
    SET(LINK_JEMALLOC "-L${CMAKE_BINARY_DIR}/build/lib -ljemalloc")
    ADD_DEPENDENCIES(shell jemalloc)
ELSE ()
    SET(LINK_JEMALLOC "")
ENDIF ()

13 14 15 16
IF (TD_LINUX AND TD_WEBSOCKET)
    ADD_DEFINITIONS(-DWEBSOCKET -I${CMAKE_BINARY_DIR}/build/include -ltaosws)
    SET(LINK_WEBSOCKET "-L${CMAKE_BINARY_DIR}/build/lib -ltaosws")
    ADD_DEPENDENCIES(shell taosws-rs)
wafwerar's avatar
wafwerar 已提交
17 18 19 20
ELSEIF (TD_DARWIN AND TD_WEBSOCKET)
    ADD_DEFINITIONS(-DWEBSOCKET -I${CMAKE_BINARY_DIR}/build/include)
    SET(LINK_WEBSOCKET "${CMAKE_BINARY_DIR}/build/lib/libtaosws.dylib")
    ADD_DEPENDENCIES(shell taosws-rs)
wafwerar's avatar
wafwerar 已提交
21 22 23 24
ELSEIF (TD_WINDOWS AND TD_WEBSOCKET)
    ADD_DEFINITIONS(-DWEBSOCKET -I${CMAKE_BINARY_DIR}/build/include)
    SET(LINK_WEBSOCKET "${CMAKE_BINARY_DIR}/build/lib/taosws.dll.lib")
    ADD_DEPENDENCIES(shell taosws-rs)
25 26 27 28
ELSE ()
    SET(LINK_WEBSOCKET "")
ENDIF ()

sangshuduo's avatar
sangshuduo 已提交
29
IF (CUS_NAME OR CUS_PROMPT OR CUS_EMAIL)
sangshuduo's avatar
sangshuduo 已提交
30
    ADD_DEFINITIONS(-I${CMAKE_CURRENT_SOURCE_DIR}/../../../enterprise/packaging)
sangshuduo's avatar
sangshuduo 已提交
31
ENDIF (CUS_NAME OR CUS_PROMPT OR CUS_EMAIL)
sangshuduo's avatar
sangshuduo 已提交
32

sangshuduo's avatar
sangshuduo 已提交
33 34 35 36 37 38
IF (TD_LINUX AND TD_ALPINE)
    SET(LINK_ARGP "/usr/lib/libargp.a")
ELSE ()
    SET(LINK_ARGP "")
ENDIF ()

wafwerar's avatar
wafwerar 已提交
39
if(TD_WINDOWS)
40
    target_link_libraries(shell PUBLIC taos_static ${LINK_WEBSOCKET})
wafwerar's avatar
wafwerar 已提交
41
else()
sangshuduo's avatar
sangshuduo 已提交
42
    target_link_libraries(shell PUBLIC taos ${LINK_WEBSOCKET} ${LINK_JEMALLOC} ${LINK_ARGP})
wafwerar's avatar
wafwerar 已提交
43
endif ()
sangshuduo's avatar
sangshuduo 已提交
44

S
Shengliang Guan 已提交
45 46
target_link_libraries(
    shell
47
    PRIVATE os common transport util
S
Shengliang Guan 已提交
48
)
sangshuduo's avatar
sangshuduo 已提交
49

S
Shengliang Guan 已提交
50 51 52 53
target_include_directories(
    shell
    PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
)
S
Shengliang Guan 已提交
54 55

SET_TARGET_PROPERTIES(shell PROPERTIES OUTPUT_NAME taos)