refactor: do not compile test-related files when BUILD_TEST=OFF
This commit is contained in:
parent
f88c249fa4
commit
5db648038b
|
@ -33,12 +33,13 @@ target_include_directories(api INTERFACE "include/client")
|
||||||
if(${BUILD_TEST})
|
if(${BUILD_TEST})
|
||||||
include(CTest)
|
include(CTest)
|
||||||
enable_testing()
|
enable_testing()
|
||||||
|
add_subdirectory(examples/c)
|
||||||
|
add_subdirectory(utils/test/c)
|
||||||
endif(${BUILD_TEST})
|
endif(${BUILD_TEST})
|
||||||
|
|
||||||
add_subdirectory(source)
|
add_subdirectory(source)
|
||||||
add_subdirectory(tools)
|
add_subdirectory(tools)
|
||||||
add_subdirectory(utils)
|
add_subdirectory(utils)
|
||||||
add_subdirectory(examples/c)
|
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
include(${TD_SUPPORT_DIR}/cmake.install)
|
include(${TD_SUPPORT_DIR}/cmake.install)
|
||||||
|
|
||||||
|
|
|
@ -41,28 +41,26 @@ target_link_libraries(
|
||||||
PUBLIC uv_a
|
PUBLIC uv_a
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(runUdf test/runUdf.c)
|
if(${BUILD_TEST})
|
||||||
target_include_directories(
|
add_executable(runUdf test/runUdf.c)
|
||||||
runUdf
|
target_include_directories(
|
||||||
PUBLIC
|
runUdf
|
||||||
"${TD_SOURCE_DIR}/include/libs/function"
|
PUBLIC
|
||||||
"${TD_SOURCE_DIR}/contrib/libuv/include"
|
"${TD_SOURCE_DIR}/include/libs/function"
|
||||||
"${TD_SOURCE_DIR}/include/util"
|
"${TD_SOURCE_DIR}/contrib/libuv/include"
|
||||||
"${TD_SOURCE_DIR}/include/common"
|
"${TD_SOURCE_DIR}/include/util"
|
||||||
"${TD_SOURCE_DIR}/include/client"
|
"${TD_SOURCE_DIR}/include/common"
|
||||||
"${TD_SOURCE_DIR}/include/os"
|
"${TD_SOURCE_DIR}/include/client"
|
||||||
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
|
"${TD_SOURCE_DIR}/include/os"
|
||||||
)
|
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
|
||||||
|
)
|
||||||
|
|
||||||
IF(TD_LINUX_64 AND JEMALLOC_ENABLED)
|
target_link_libraries(
|
||||||
ADD_DEPENDENCIES(runUdf jemalloc)
|
runUdf
|
||||||
ENDIF()
|
PUBLIC uv_a
|
||||||
|
PRIVATE os util common nodes function ${LINK_JEMALLOC}
|
||||||
target_link_libraries(
|
)
|
||||||
runUdf
|
endif()
|
||||||
PUBLIC uv_a
|
|
||||||
PRIVATE os util common nodes function ${LINK_JEMALLOC}
|
|
||||||
)
|
|
||||||
|
|
||||||
add_library(udf1 STATIC MODULE test/udf1.c)
|
add_library(udf1 STATIC MODULE test/udf1.c)
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
# ADD_SUBDIRECTORY(examples/c)
|
# ADD_SUBDIRECTORY(examples/c)
|
||||||
ADD_SUBDIRECTORY(tsim)
|
ADD_SUBDIRECTORY(tsim)
|
||||||
ADD_SUBDIRECTORY(test/c)
|
|
||||||
|
|
||||||
# ADD_SUBDIRECTORY(comparisonTest/tdengine)
|
# ADD_SUBDIRECTORY(comparisonTest/tdengine)
|
||||||
IF(NOT "${TSZ_ENABLED}" MATCHES "false")
|
IF(NOT "${TSZ_ENABLED}" MATCHES "false")
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
add_executable(tmq_demo tmqDemo.c)
|
add_executable(tmq_demo tmqDemo.c)
|
||||||
add_dependencies(tmq_demo ${TAOS_LIB})
|
|
||||||
add_executable(tmq_sim tmqSim.c)
|
add_executable(tmq_sim tmqSim.c)
|
||||||
add_executable(create_table createTable.c)
|
add_executable(create_table createTable.c)
|
||||||
add_executable(tmq_taosx_ci tmq_taosx_ci.c)
|
add_executable(tmq_taosx_ci tmq_taosx_ci.c)
|
||||||
|
@ -47,6 +46,7 @@ target_link_libraries(
|
||||||
PUBLIC common
|
PUBLIC common
|
||||||
PUBLIC os
|
PUBLIC os
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
tmq_demo
|
tmq_demo
|
||||||
PUBLIC ${TAOS_LIB}
|
PUBLIC ${TAOS_LIB}
|
||||||
|
@ -54,6 +54,7 @@ target_link_libraries(
|
||||||
PUBLIC common
|
PUBLIC common
|
||||||
PUBLIC os
|
PUBLIC os
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
tmq_sim
|
tmq_sim
|
||||||
PUBLIC ${TAOS_LIB_PLATFORM_SPEC}
|
PUBLIC ${TAOS_LIB_PLATFORM_SPEC}
|
||||||
|
@ -61,6 +62,7 @@ target_link_libraries(
|
||||||
PUBLIC common
|
PUBLIC common
|
||||||
PUBLIC os
|
PUBLIC os
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
tmq_ts5466
|
tmq_ts5466
|
||||||
PUBLIC ${TAOS_LIB}
|
PUBLIC ${TAOS_LIB}
|
||||||
|
@ -68,6 +70,7 @@ target_link_libraries(
|
||||||
PUBLIC common
|
PUBLIC common
|
||||||
PUBLIC os
|
PUBLIC os
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
tmq_td32187
|
tmq_td32187
|
||||||
PUBLIC ${TAOS_LIB}
|
PUBLIC ${TAOS_LIB}
|
||||||
|
@ -75,6 +78,7 @@ target_link_libraries(
|
||||||
PUBLIC common
|
PUBLIC common
|
||||||
PUBLIC os
|
PUBLIC os
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
tmq_td32471
|
tmq_td32471
|
||||||
PUBLIC ${TAOS_LIB}
|
PUBLIC ${TAOS_LIB}
|
||||||
|
@ -82,6 +86,7 @@ target_link_libraries(
|
||||||
PUBLIC common
|
PUBLIC common
|
||||||
PUBLIC os
|
PUBLIC os
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
tmq_td33798
|
tmq_td33798
|
||||||
PUBLIC ${TAOS_LIB}
|
PUBLIC ${TAOS_LIB}
|
||||||
|
@ -89,6 +94,7 @@ target_link_libraries(
|
||||||
PUBLIC common
|
PUBLIC common
|
||||||
PUBLIC os
|
PUBLIC os
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
tmq_td32526
|
tmq_td32526
|
||||||
PUBLIC ${TAOS_LIB}
|
PUBLIC ${TAOS_LIB}
|
||||||
|
@ -96,6 +102,7 @@ target_link_libraries(
|
||||||
PUBLIC common
|
PUBLIC common
|
||||||
PUBLIC os
|
PUBLIC os
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
tmq_ts5776
|
tmq_ts5776
|
||||||
PUBLIC ${TAOS_LIB}
|
PUBLIC ${TAOS_LIB}
|
||||||
|
@ -103,6 +110,7 @@ target_link_libraries(
|
||||||
PUBLIC common
|
PUBLIC common
|
||||||
PUBLIC os
|
PUBLIC os
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
tmq_taosx_ci
|
tmq_taosx_ci
|
||||||
PUBLIC ${TAOS_LIB}
|
PUBLIC ${TAOS_LIB}
|
||||||
|
@ -110,6 +118,7 @@ target_link_libraries(
|
||||||
PUBLIC common
|
PUBLIC common
|
||||||
PUBLIC os
|
PUBLIC os
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
tmq_offset_test
|
tmq_offset_test
|
||||||
PUBLIC ${TAOS_LIB}
|
PUBLIC ${TAOS_LIB}
|
||||||
|
|
Loading…
Reference in New Issue