TDengine/source/libs/function/CMakeLists.txt

166 lines
4.5 KiB
Text
Raw Normal View History

aux_source_directory(src FUNCTION_SRC)
2022-11-10 07:37:18 +00:00
aux_source_directory(src/detail FUNCTION_SRC_DETAIL)
2022-03-24 06:09:29 +00:00
list(REMOVE_ITEM FUNCTION_SRC src/udfd.c)
2022-11-10 07:37:18 +00:00
add_library(function STATIC ${FUNCTION_SRC} ${FUNCTION_SRC_DETAIL})
target_include_directories(
function
2022-03-25 00:34:46 +00:00
PUBLIC
2022-04-10 11:08:16 +00:00
"${TD_SOURCE_DIR}/include/libs/function"
"${TD_SOURCE_DIR}/include/util"
"${TD_SOURCE_DIR}/include/common"
"${TD_SOURCE_DIR}/include/client"
2022-04-10 11:08:16 +00:00
"${TD_SOURCE_DIR}/contrib/libuv/include"
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
)
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 ()
target_link_libraries(
function
2022-10-12 03:09:42 +00:00
PRIVATE os
PRIVATE util
PRIVATE common
PRIVATE nodes
PRIVATE qcom
2022-10-12 05:49:40 +00:00
PRIVATE scalar
Feature/3.0 geometry (#21037) * Add GEOMETRY data type and make sql.c able to parse it. The GEMETRY works like BINARY so far. * add GEOMETRY type into gConvertTypes to fix some issues like DELETE calling * change some test cases to make sure no same timestamp is inserted, and add my smoketest.sh * Add a function MakePoint() and introduce a lib geometry * implement sql functions GeomFromText() and AsText() * Use GEOS *_r funcions instead for thread safety * Handle with TSDB_DATA_TYPE_GEOMETRY when INSERT geometry data by converting WKT. Add geosWrapper to wrap the basic GEOS functions for TDEngine. * refactor AsText and MakePoint functions to be like GeomFromText * Show WKT when print geometry data in screen Dump hex data when dump geometry data in a file * define TYPE_BYTES item for TSDB_DATA_TYPE_GEOMETRY, which casued some strange issues. * set number of decimals of WKT to 6 * Implement SQL function Intersects() * refactor geometry sql functions * Add geosErrMsgeHandler() to get the GEOS error detail * use threadlocal to instantiate SGeosContext call destroyGeosContext() only if the thread exists * remove SGeosContext *context param for all geometry functions since we use thread local one, so that all caller do not need to know the context. * Modify Intersects() to call PreparedIntersects() when one of param is a constant, which has higher performance. * rename prepareFn() to initCtxFn() to avoid confusion with PreparedFn * Add prefix "ST_" for all geometry functions * move getThreadLocalGeosCtx() and destroyThreadLocalGeosCtx() into util, so that all unit test tools can compile * Add unit test for geometry lib, only test MakePoint so far * refactor and enhance existing cases in geomFuncTest * implement NULL type and NULL value test for geomFuncTest * add test on geomFromText() * add unit test on AsText() in geomFuncTest * combine some makePointFunction test items * add intersectsFunctionTwoColumns test refactor on callGeomFromTextWrapper functions * enhance intersectsFunction test to add cases like input constant , NULL type, NULL value, or wrong content * add more cases into intersectsFunction test * Add basic test on geometry in system test * Add ST_GeomFromText and ST_AsText function test in system test on geometry * add ST_Intersects function test in system test on geometry * support to check expectedErrno in system test on geometry * adjust geomTest unit test and geometry system test * add geometry data type and functions in doc english version * implement touchesFunction() in geometry lib refactor geometry relation functions model * separate gemFuncTest into several src files * add unit test on touchesFunction * support sql function ST_Touches() add system test on ST_Touches * add docs for ST_Touches() * Add ST_Contains() * Add ST_Covers() * Add ST_Equals() * add swapAllowed param for geomRelationFunction() read geom2 earlier intead of at doGeosRelation() * Add ST_ContainsProperly() * build on windows * Merge from 3.0 to 3.0_geometry * change macro definition TSDB_DATA_TYPE_GEOMETRY as the last one for compatibility * change '\\NULL' to 'NULL' back in shellDumpFieldToFile() * add /usr/local/include into include directory * add /usr/local/inlcude and /usr/local/lib in cmake.platform for DARWIN
2023-05-24 07:36:46 +00:00
PRIVATE geometry
2022-10-12 05:49:40 +00:00
PRIVATE transport
2022-03-25 00:34:46 +00:00
PUBLIC uv_a
)
2022-03-24 06:09:29 +00:00
2022-03-24 08:59:43 +00:00
add_executable(runUdf test/runUdf.c)
target_include_directories(
runUdf
2022-03-25 00:34:46 +00:00
PUBLIC
2022-04-10 11:08:16 +00:00
"${TD_SOURCE_DIR}/include/libs/function"
"${TD_SOURCE_DIR}/contrib/libuv/include"
"${TD_SOURCE_DIR}/include/util"
"${TD_SOURCE_DIR}/include/common"
"${TD_SOURCE_DIR}/include/client"
2022-04-10 11:08:16 +00:00
"${TD_SOURCE_DIR}/include/os"
2022-03-24 08:59:43 +00:00
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
)
IF (TD_LINUX_64 AND JEMALLOC_ENABLED)
ADD_DEPENDENCIES(runUdf jemalloc)
ENDIF ()
2022-03-24 08:59:43 +00:00
target_link_libraries(
runUdf
2022-03-25 00:34:46 +00:00
PUBLIC uv_a
PRIVATE os util common nodes function ${LINK_JEMALLOC}
2022-03-24 08:59:43 +00:00
)
2022-05-08 19:22:05 +00:00
add_library(udf1 STATIC MODULE test/udf1.c)
2022-03-24 08:59:43 +00:00
target_include_directories(
udf1
2022-03-25 00:34:46 +00:00
PUBLIC
2022-04-10 11:08:16 +00:00
"${TD_SOURCE_DIR}/include/libs/function"
2022-04-14 11:29:41 +00:00
"${TD_SOURCE_DIR}/include/util"
"${TD_SOURCE_DIR}/include/common"
"${TD_SOURCE_DIR}/include/client"
2022-04-10 11:08:16 +00:00
"${TD_SOURCE_DIR}/include/os"
2022-03-24 08:59:43 +00:00
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
)
IF (TD_LINUX_64 AND JEMALLOC_ENABLED)
ADD_DEPENDENCIES(udf1 jemalloc)
ENDIF ()
2022-04-22 01:54:27 +00:00
target_link_libraries(
udf1 PUBLIC os ${LINK_JEMALLOC})
2022-03-24 08:59:43 +00:00
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})
2022-05-08 19:22:05 +00:00
add_library(udf2 STATIC MODULE test/udf2.c)
2022-04-26 10:28:30 +00:00
target_include_directories(
udf2
2022-04-26 10:28:30 +00:00
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 jemalloc)
ENDIF ()
2022-04-26 10:28:30 +00:00
target_link_libraries(
udf2 PUBLIC os ${LINK_JEMALLOC}
2022-04-26 10:28:30 +00:00
)
2023-04-20 06:32:32 +00:00
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}
)
2022-03-24 08:59:43 +00:00
#SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/build/bin)
2022-03-24 06:09:29 +00:00
add_executable(udfd src/udfd.c)
target_include_directories(
udfd
2022-03-25 00:34:46 +00:00
PUBLIC
2022-04-10 11:08:16 +00:00
"${TD_SOURCE_DIR}/include/libs/function"
"${TD_SOURCE_DIR}/contrib/libuv/include"
"${TD_SOURCE_DIR}/include/util"
"${TD_SOURCE_DIR}/include/common"
"${TD_SOURCE_DIR}/include/libs/transport"
"${TD_SOURCE_DIR}/include/client"
2022-03-24 06:09:29 +00:00
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
)
IF (TD_LINUX_64 AND JEMALLOC_ENABLED)
ADD_DEPENDENCIES(udfd jemalloc)
ENDIF ()
2022-03-24 06:09:29 +00:00
target_link_libraries(
udfd
PUBLIC uv_a
PRIVATE os util common nodes function ${LINK_JEMALLOC}
)
2022-03-24 08:59:43 +00:00