2017-04-21 17:47:27 +00:00
|
|
|
include(${ClickHouse_SOURCE_DIR}/cmake/dbms_glob_sources.cmake)
|
2017-07-26 18:14:07 +00:00
|
|
|
include(${ClickHouse_SOURCE_DIR}/cmake/dbms_generate_function.cmake)
|
|
|
|
|
|
|
|
generate_function_register(Arithmetic
|
|
|
|
FunctionPlus
|
|
|
|
FunctionMinus
|
|
|
|
FunctionMultiply
|
|
|
|
FunctionDivideFloating
|
|
|
|
FunctionDivideIntegral
|
|
|
|
FunctionDivideIntegralOrZero
|
|
|
|
FunctionModulo
|
|
|
|
FunctionNegate
|
|
|
|
FunctionAbs
|
|
|
|
FunctionBitAnd
|
|
|
|
FunctionBitOr
|
|
|
|
FunctionBitXor
|
|
|
|
FunctionBitNot
|
|
|
|
FunctionBitShiftLeft
|
|
|
|
FunctionBitShiftRight
|
|
|
|
FunctionBitRotateLeft
|
|
|
|
FunctionBitRotateRight
|
|
|
|
FunctionLeast
|
|
|
|
FunctionGreatest
|
|
|
|
FunctionBitTest
|
|
|
|
FunctionBitTestAny
|
|
|
|
FunctionBitTestAll
|
2017-11-22 10:48:59 +00:00
|
|
|
FunctionGCD
|
|
|
|
FunctionLCM
|
2017-12-21 23:46:34 +00:00
|
|
|
FunctionIntExp2
|
|
|
|
FunctionIntExp10
|
2017-07-26 18:14:07 +00:00
|
|
|
)
|
|
|
|
|
2017-07-30 12:31:58 +00:00
|
|
|
generate_function_register(Array
|
|
|
|
FunctionArray
|
|
|
|
FunctionArrayElement
|
|
|
|
FunctionHas
|
|
|
|
FunctionIndexOf
|
|
|
|
FunctionCountEqual
|
|
|
|
FunctionArrayEnumerate
|
|
|
|
FunctionArrayEnumerateUniq
|
|
|
|
FunctionArrayUniq
|
|
|
|
FunctionEmptyArrayUInt8
|
|
|
|
FunctionEmptyArrayUInt16
|
|
|
|
FunctionEmptyArrayUInt32
|
|
|
|
FunctionEmptyArrayUInt64
|
|
|
|
FunctionEmptyArrayInt8
|
|
|
|
FunctionEmptyArrayInt16
|
|
|
|
FunctionEmptyArrayInt32
|
|
|
|
FunctionEmptyArrayInt64
|
|
|
|
FunctionEmptyArrayFloat32
|
|
|
|
FunctionEmptyArrayFloat64
|
|
|
|
FunctionEmptyArrayDate
|
|
|
|
FunctionEmptyArrayDateTime
|
|
|
|
FunctionEmptyArrayString
|
|
|
|
FunctionEmptyArrayToSingle
|
|
|
|
FunctionRange
|
|
|
|
FunctionArrayReduce
|
|
|
|
FunctionArrayReverse
|
2017-08-16 17:50:12 +00:00
|
|
|
FunctionArrayConcat
|
2017-08-22 17:54:14 +00:00
|
|
|
FunctionArraySlice
|
2017-08-24 13:00:23 +00:00
|
|
|
FunctionArrayPushBack
|
|
|
|
FunctionArrayPushFront
|
|
|
|
FunctionArrayPopBack
|
|
|
|
FunctionArrayPopFront
|
2018-01-09 15:24:27 +00:00
|
|
|
FunctionArrayHasAll
|
|
|
|
FunctionArrayHasAny
|
2018-01-12 14:57:04 +00:00
|
|
|
FunctionArrayIntersect
|
2018-01-19 18:47:17 +00:00
|
|
|
FunctionArrayResize
|
2017-07-30 12:31:58 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
2017-04-21 17:47:27 +00:00
|
|
|
add_headers_and_sources(clickhouse_functions .)
|
2018-01-10 15:45:05 +00:00
|
|
|
add_headers_and_sources(clickhouse_functions ./GatherUtils)
|
2017-04-21 17:47:27 +00:00
|
|
|
add_headers_and_sources(clickhouse_functions ./Conditional)
|
2017-07-26 18:14:07 +00:00
|
|
|
add_headers_and_sources(clickhouse_functions ${ClickHouse_BINARY_DIR}/dbms/src/Functions)
|
2017-04-21 17:47:27 +00:00
|
|
|
|
2017-12-09 07:32:32 +00:00
|
|
|
list(REMOVE_ITEM clickhouse_functions_sources IFunction.cpp FunctionFactory.cpp FunctionHelpers.cpp)
|
|
|
|
list(REMOVE_ITEM clickhouse_functions_headers IFunction.h FunctionFactory.h FunctionHelpers.h)
|
2017-04-21 17:47:27 +00:00
|
|
|
|
2017-11-24 18:08:01 +00:00
|
|
|
add_library(clickhouse_functions ${clickhouse_functions_sources})
|
2018-04-07 02:29:12 +00:00
|
|
|
|
2018-04-23 14:51:56 +00:00
|
|
|
llvm_map_components_to_libraries(REQUIRED_LLVM_LIBRARIES all)
|
|
|
|
|
|
|
|
target_link_libraries(clickhouse_functions PUBLIC dbms PRIVATE libconsistent-hashing ${FARMHASH_LIBRARIES} ${METROHASH_LIBRARIES} ${REQUIRED_LLVM_LIBRARIES})
|
2018-04-07 02:29:12 +00:00
|
|
|
|
2017-06-23 20:22:35 +00:00
|
|
|
target_include_directories (clickhouse_functions BEFORE PUBLIC ${ClickHouse_SOURCE_DIR}/contrib/libfarmhash)
|
|
|
|
target_include_directories (clickhouse_functions BEFORE PUBLIC ${ClickHouse_SOURCE_DIR}/contrib/libmetrohash/src)
|
2017-08-09 20:52:55 +00:00
|
|
|
target_include_directories (clickhouse_functions BEFORE PUBLIC ${DIVIDE_INCLUDE_DIR})
|
2018-04-23 14:51:56 +00:00
|
|
|
target_include_directories (clickhouse_functions BEFORE PUBLIC ${LLVM_INCLUDE_DIRS})
|
|
|
|
|
|
|
|
# LLVM 5.0 has a bunch of unused parameters in its header files.
|
|
|
|
set_source_files_properties(FunctionsLLVMTest.cpp PROPERTIES COMPILE_FLAGS "-Wno-unused-parameter -g")
|
2017-04-21 17:47:27 +00:00
|
|
|
|
2017-10-25 18:39:10 +00:00
|
|
|
if (CMAKE_BUILD_TYPE_UC STREQUAL "RELEASE" OR CMAKE_BUILD_TYPE_UC STREQUAL "RELWITHDEBINFO" OR CMAKE_BUILD_TYPE_UC STREQUAL "MINSIZEREL")
|
2017-10-24 13:30:44 +00:00
|
|
|
# Won't generate debug info for files with heavy template instantiation to achieve faster linking and lower size.
|
|
|
|
target_compile_options(clickhouse_functions PRIVATE "-g0")
|
|
|
|
endif ()
|
|
|
|
|
2018-01-19 17:04:32 +00:00
|
|
|
if (USE_ICU)
|
|
|
|
#target_link_libraries (clickhouse_functions ${ICU_LIBS})
|
|
|
|
target_include_directories (clickhouse_functions PRIVATE ${ICU_INCLUDE_DIR})
|
|
|
|
endif ()
|
|
|
|
|
2017-08-03 12:44:39 +00:00
|
|
|
if (USE_VECTORCLASS)
|
|
|
|
target_include_directories (clickhouse_functions BEFORE PUBLIC ${VECTORCLASS_INCLUDE_DIR})
|
|
|
|
endif ()
|
|
|
|
|
2016-12-01 22:44:59 +00:00
|
|
|
if (ENABLE_TESTS)
|
2017-04-01 07:20:54 +00:00
|
|
|
add_subdirectory (tests)
|
2017-04-10 17:43:30 +00:00
|
|
|
endif ()
|