ClickHouse/src/Functions/CMakeLists.txt

123 lines
4.0 KiB
CMake
Raw Normal View History

2019-12-15 06:34:43 +00:00
configure_file(config_functions.h.in ${ConfigIncludePath}/config_functions.h)
2019-06-20 09:12:49 +00:00
2017-04-21 17:47:27 +00:00
include(${ClickHouse_SOURCE_DIR}/cmake/dbms_glob_sources.cmake)
add_headers_and_sources(clickhouse_functions .)
list(REMOVE_ITEM clickhouse_functions_sources IFunctionImpl.cpp FunctionFactory.cpp FunctionHelpers.cpp)
list(REMOVE_ITEM clickhouse_functions_headers IFunctionImpl.h FunctionFactory.h FunctionHelpers.h)
2017-04-21 17:47:27 +00:00
add_library(clickhouse_functions ${clickhouse_functions_sources})
target_link_libraries(clickhouse_functions
PUBLIC
${BASE64_LIBRARY}
${CITYHASH_LIBRARIES}
${FARMHASH_LIBRARIES}
${FASTOPS_LIBRARY}
clickhouse_dictionaries
clickhouse_dictionaries_embedded
2020-08-17 08:20:20 +00:00
clickhouse_parsers
consistent-hashing
dbms
metrohash
murmurhash
PRIVATE
${ZLIB_LIBRARIES}
boost::filesystem
libdivide
)
if (OPENSSL_CRYPTO_LIBRARY)
target_link_libraries(clickhouse_functions PUBLIC ${OPENSSL_CRYPTO_LIBRARY})
endif()
target_include_directories(clickhouse_functions SYSTEM PRIVATE ${SPARSEHASH_INCLUDE_DIR})
2017-04-21 17:47:27 +00:00
2020-09-10 11:07:08 +00:00
if (CMAKE_BUILD_TYPE_UC STREQUAL "RELEASE"
OR CMAKE_BUILD_TYPE_UC STREQUAL "RELWITHDEBINFO"
OR CMAKE_BUILD_TYPE_UC STREQUAL "MINSIZEREL")
set (STRIP_DSF_DEFAULT ON)
else()
set (STRIP_DSF_DEFAULT OFF)
endif()
2020-09-15 21:12:37 +00:00
# Provides faster linking and lower binary size.
# Tradeoff is the inability to debug some source files with e.g. gdb
# (empty stack frames and no local variables)."
option(STRIP_DEBUG_SYMBOLS_FUNCTIONS "Do not generate debugger info for ClickHouse functions" ${STRIP_DSF_DEFAULT})
2020-09-09 18:17:01 +00:00
if (STRIP_DEBUG_SYMBOLS_FUNCTIONS)
message(WARNING "Not generating debugger info for ClickHouse functions")
target_compile_options(clickhouse_functions PRIVATE "-g0")
else()
message(STATUS "Generating debugger info for ClickHouse functions")
endif()
2018-01-19 17:04:32 +00:00
if (USE_ICU)
2018-11-27 15:34:21 +00:00
target_link_libraries (clickhouse_functions PRIVATE ${ICU_LIBRARIES})
target_include_directories(clickhouse_functions SYSTEM PRIVATE ${ICU_INCLUDE_DIRS})
2018-01-19 17:04:32 +00:00
endif ()
2019-08-01 00:29:32 +00:00
if (USE_FASTOPS)
target_include_directories (clickhouse_functions SYSTEM PRIVATE ${FASTOPS_INCLUDE_DIR})
endif ()
2016-12-01 22:44:59 +00:00
if (ENABLE_TESTS)
add_subdirectory (tests)
endif ()
if (USE_EMBEDDED_COMPILER)
target_link_libraries(clickhouse_functions PRIVATE ${REQUIRED_LLVM_LIBRARIES})
target_include_directories(clickhouse_functions SYSTEM BEFORE PUBLIC ${LLVM_INCLUDE_DIRS})
endif ()
2018-10-11 16:22:50 +00:00
if(USE_BASE64)
target_include_directories(clickhouse_functions SYSTEM PRIVATE ${BASE64_INCLUDE_DIR})
endif()
target_link_libraries(clickhouse_functions PRIVATE lz4)
2019-03-25 14:34:52 +00:00
if (USE_H3)
target_link_libraries(clickhouse_functions PRIVATE ${H3_LIBRARY})
target_include_directories(clickhouse_functions SYSTEM PRIVATE ${H3_INCLUDE_DIR})
endif()
target_link_libraries(clickhouse_functions PRIVATE hyperscan)
2019-03-14 04:48:30 +00:00
2020-09-18 14:18:59 +00:00
if(USE_SIMDJSON)
2020-07-11 21:03:30 +00:00
target_link_libraries(clickhouse_functions PRIVATE simdjson)
2019-05-15 17:19:39 +00:00
endif()
if(USE_RAPIDJSON)
target_include_directories(clickhouse_functions SYSTEM PRIVATE ${RAPIDJSON_INCLUDE_DIR})
endif()
2020-09-19 17:14:37 +00:00
# ClickHouse developers may use platform-dependent code under some macro (e.g. `#ifdef ENABLE_MULTITARGET`).
2020-09-19 16:42:36 +00:00
# If turned ON, this option defines such macro.
# See `src/Functions/TargetSpecific.h`
option(ENABLE_MULTITARGET_CODE "Enable platform-dependent code" ON)
if (ENABLE_MULTITARGET_CODE)
add_definitions(-DENABLE_MULTITARGET_CODE=1)
else()
add_definitions(-DENABLE_MULTITARGET_CODE=0)
endif()
add_subdirectory(GatherUtils)
target_link_libraries(clickhouse_functions PRIVATE clickhouse_functions_gatherutils)
add_subdirectory(URL)
target_link_libraries(clickhouse_functions PRIVATE clickhouse_functions_url)
add_subdirectory(array)
target_link_libraries(clickhouse_functions PRIVATE clickhouse_functions_array)
2020-07-29 11:00:04 +00:00
if (USE_STATS)
target_link_libraries(clickhouse_functions PRIVATE stats)
endif()
2021-02-03 18:23:54 +00:00
# Signed integer overflow on user-provided data inside boost::geometry - ignore.
set_source_files_properties("pointInPolygon.cpp" PROPERTIES COMPILE_FLAGS -fno-sanitize=signed-integer-overflow)