CMakeLists.txt 4.5 KB
Newer Older
1
aux_source_directory(src FUNCTION_SRC)
H
Haojun Liao 已提交
2
aux_source_directory(src/detail FUNCTION_SRC_DETAIL)
3
list(REMOVE_ITEM FUNCTION_SRC src/udfd.c)
H
Haojun Liao 已提交
4
add_library(function STATIC ${FUNCTION_SRC} ${FUNCTION_SRC_DETAIL})
5 6
target_include_directories(
    function
S
shenglian zhou 已提交
7
    PUBLIC
wafwerar's avatar
wafwerar 已提交
8
        "${TD_SOURCE_DIR}/include/libs/function"
9 10 11
        "${TD_SOURCE_DIR}/include/util"
        "${TD_SOURCE_DIR}/include/common"
        "${TD_SOURCE_DIR}/include/client"
wafwerar's avatar
wafwerar 已提交
12
        "${TD_SOURCE_DIR}/contrib/libuv/include"
13 14 15
    PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
)

16 17 18 19 20 21 22 23 24 25 26
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")
ELSE ()
  SET(LINK_JEMALLOC "")
ENDIF ()

IF (TD_LINUX_64 AND JEMALLOC_ENABLED)
    ADD_DEPENDENCIES(function jemalloc)
ENDIF ()

27
target_link_libraries(
28
    function
H
Hongze Cheng 已提交
29 30 31 32 33
    PRIVATE os 
    PRIVATE util 
    PRIVATE common 
    PRIVATE nodes 
    PRIVATE qcom 
H
Hongze Cheng 已提交
34 35
    PRIVATE scalar 
    PRIVATE transport 
36
    PRIVATE stream ${LINK_JEMALLOC}
S
shenglian zhou 已提交
37
    PUBLIC uv_a
38
)
39

S
shenglian zhou 已提交
40 41 42
add_executable(runUdf test/runUdf.c)
target_include_directories(
        runUdf
S
shenglian zhou 已提交
43
        PUBLIC
wafwerar's avatar
wafwerar 已提交
44 45
            "${TD_SOURCE_DIR}/include/libs/function"
            "${TD_SOURCE_DIR}/contrib/libuv/include"
46 47 48
            "${TD_SOURCE_DIR}/include/util"
            "${TD_SOURCE_DIR}/include/common"
            "${TD_SOURCE_DIR}/include/client"
wafwerar's avatar
wafwerar 已提交
49
            "${TD_SOURCE_DIR}/include/os"
S
shenglian zhou 已提交
50 51
        PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
)
52 53 54 55 56

IF (TD_LINUX_64 AND JEMALLOC_ENABLED)
    ADD_DEPENDENCIES(runUdf jemalloc)
ENDIF ()

S
shenglian zhou 已提交
57 58
target_link_libraries(
        runUdf
S
shenglian zhou 已提交
59
        PUBLIC uv_a
60
        PRIVATE os util common nodes function ${LINK_JEMALLOC}
S
shenglian zhou 已提交
61 62
)

wafwerar's avatar
wafwerar 已提交
63
add_library(udf1 STATIC MODULE test/udf1.c)
S
shenglian zhou 已提交
64 65
target_include_directories(
        udf1
S
shenglian zhou 已提交
66
        PUBLIC
wafwerar's avatar
wafwerar 已提交
67
            "${TD_SOURCE_DIR}/include/libs/function"
S
shenglian zhou 已提交
68
            "${TD_SOURCE_DIR}/include/util"
69 70
            "${TD_SOURCE_DIR}/include/common"
            "${TD_SOURCE_DIR}/include/client"
wafwerar's avatar
wafwerar 已提交
71
            "${TD_SOURCE_DIR}/include/os"
S
shenglian zhou 已提交
72 73
        PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
)
74 75 76 77 78

IF (TD_LINUX_64 AND JEMALLOC_ENABLED)
    ADD_DEPENDENCIES(udf1 jemalloc)
ENDIF ()

wafwerar's avatar
wafwerar 已提交
79
target_link_libraries(
80
    udf1 PUBLIC os ${LINK_JEMALLOC})
S
shenglian zhou 已提交
81

82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101

add_library(udf1_dup STATIC MODULE test/udf1_dup.c)
target_include_directories(
        udf1_dup
        PUBLIC
            "${TD_SOURCE_DIR}/include/libs/function"
            "${TD_SOURCE_DIR}/include/util"
            "${TD_SOURCE_DIR}/include/common"
            "${TD_SOURCE_DIR}/include/client"
            "${TD_SOURCE_DIR}/include/os"
        PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
)

IF (TD_LINUX_64 AND JEMALLOC_ENABLED)
    ADD_DEPENDENCIES(udf1_dup jemalloc)
ENDIF ()

target_link_libraries(
    udf1_dup PUBLIC os ${LINK_JEMALLOC})

wafwerar's avatar
wafwerar 已提交
102
add_library(udf2 STATIC MODULE test/udf2.c)
S
slzhou 已提交
103
target_include_directories(
104
        udf2
S
slzhou 已提交
105 106 107 108 109 110 111 112
        PUBLIC
            "${TD_SOURCE_DIR}/include/libs/function"
            "${TD_SOURCE_DIR}/include/util"
            "${TD_SOURCE_DIR}/include/common"
            "${TD_SOURCE_DIR}/include/client"
            "${TD_SOURCE_DIR}/include/os"
        PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
)
113 114 115 116 117

IF (TD_LINUX_64 AND JEMALLOC_ENABLED)
    ADD_DEPENDENCIES(udf2 jemalloc)
ENDIF ()

S
slzhou 已提交
118
target_link_libraries(
119
    udf2 PUBLIC os ${LINK_JEMALLOC}
S
slzhou 已提交
120 121
)

A
Alex Duan 已提交
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
add_library(udf2_dup STATIC MODULE test/udf2_dup.c)
target_include_directories(
        udf2_dup
        PUBLIC
            "${TD_SOURCE_DIR}/include/libs/function"
            "${TD_SOURCE_DIR}/include/util"
            "${TD_SOURCE_DIR}/include/common"
            "${TD_SOURCE_DIR}/include/client"
            "${TD_SOURCE_DIR}/include/os"
        PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
)

IF (TD_LINUX_64 AND JEMALLOC_ENABLED)
    ADD_DEPENDENCIES(udf2_dup jemalloc)
ENDIF ()

target_link_libraries(
    udf2_dup PUBLIC os ${LINK_JEMALLOC}
)

S
shenglian zhou 已提交
142
#SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/build/bin)
143 144 145
add_executable(udfd src/udfd.c)
target_include_directories(
        udfd
S
shenglian zhou 已提交
146
        PUBLIC
wafwerar's avatar
wafwerar 已提交
147 148
            "${TD_SOURCE_DIR}/include/libs/function"
            "${TD_SOURCE_DIR}/contrib/libuv/include"
149 150
            "${TD_SOURCE_DIR}/include/util"
            "${TD_SOURCE_DIR}/include/common"
151
            "${TD_SOURCE_DIR}/include/libs/transport"
152
            "${TD_SOURCE_DIR}/include/client"
153 154 155
        PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
)

156 157 158 159
IF (TD_LINUX_64 AND JEMALLOC_ENABLED)
    ADD_DEPENDENCIES(udfd jemalloc)
ENDIF ()

160
target_link_libraries(
161 162 163 164
    udfd
    PUBLIC uv_a
    PRIVATE os util common nodes function ${LINK_JEMALLOC}
    )
S
shenglian zhou 已提交
165