2017-09-10 06:51:27 +00:00
|
|
|
if (USE_INCLUDE_WHAT_YOU_USE)
|
|
|
|
set (CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
|
|
|
|
endif ()
|
|
|
|
|
2018-12-27 15:23:37 +00:00
|
|
|
set (MAX_COMPILER_MEMORY 2500 CACHE INTERNAL "")
|
|
|
|
if (MAKE_STATIC_LIBRARIES)
|
|
|
|
set (MAX_LINKER_MEMORY 3500 CACHE INTERNAL "")
|
|
|
|
else()
|
|
|
|
set (MAX_LINKER_MEMORY 2500 CACHE INTERNAL "")
|
|
|
|
endif ()
|
|
|
|
include (../cmake/limit_jobs.cmake)
|
|
|
|
|
|
|
|
include(cmake/find_vectorclass.cmake)
|
2017-03-14 13:47:39 +00:00
|
|
|
|
2017-04-01 09:19:00 +00:00
|
|
|
set (CONFIG_VERSION ${CMAKE_CURRENT_BINARY_DIR}/src/Common/config_version.h)
|
|
|
|
set (CONFIG_COMMON ${CMAKE_CURRENT_BINARY_DIR}/src/Common/config.h)
|
2017-03-14 13:47:39 +00:00
|
|
|
|
|
|
|
include (cmake/version.cmake)
|
|
|
|
message (STATUS "Will build ${VERSION_FULL}")
|
2018-12-27 15:23:37 +00:00
|
|
|
configure_file (src/Common/config.h.in ${CONFIG_COMMON})
|
|
|
|
configure_file (src/Common/config_version.h.in ${CONFIG_VERSION})
|
2017-03-14 13:47:39 +00:00
|
|
|
|
2018-03-02 00:17:25 +00:00
|
|
|
if (NOT MSVC)
|
|
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
|
|
|
|
endif ()
|
2017-12-01 17:49:12 +00:00
|
|
|
|
2017-01-19 19:30:58 +00:00
|
|
|
if (NOT NO_WERROR)
|
2017-04-01 07:20:54 +00:00
|
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
|
|
|
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
|
2017-01-19 19:30:58 +00:00
|
|
|
endif ()
|
|
|
|
|
2018-09-02 00:34:34 +00:00
|
|
|
# Add some warnings that are not available even with -Wall -Wextra.
|
|
|
|
|
2018-08-26 00:39:11 +00:00
|
|
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
2018-08-27 18:21:34 +00:00
|
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra-semi -Wcomma -Winconsistent-missing-destructor-override -Wunused-exception-parameter -Wshadow-uncaptured-local")
|
2018-08-26 12:38:45 +00:00
|
|
|
|
2018-09-02 05:35:03 +00:00
|
|
|
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6)
|
2018-08-26 12:38:45 +00:00
|
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wredundant-parens -Wzero-as-null-pointer-constant")
|
|
|
|
endif ()
|
2018-08-26 00:39:11 +00:00
|
|
|
endif ()
|
|
|
|
|
2018-08-29 00:03:07 +00:00
|
|
|
if (USE_DEBUG_HELPERS)
|
2018-09-05 18:50:17 +00:00
|
|
|
set (INCLUDE_DEBUG_HELPERS "-include ${ClickHouse_SOURCE_DIR}/libs/libcommon/include/common/iostream_debug_helpers.h")
|
|
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${INCLUDE_DEBUG_HELPERS}")
|
2018-08-29 00:03:07 +00:00
|
|
|
endif ()
|
|
|
|
|
2018-09-03 17:45:52 +00:00
|
|
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
|
|
# If we leave this optimization enabled, gcc-7 replaces a pair of SSE intrinsics (16 byte load, store) with a call to memcpy.
|
|
|
|
# It leads to slow code. This is compiler bug. It looks like this:
|
|
|
|
#
|
|
|
|
# (gdb) bt
|
|
|
|
#0 memcpy (destination=0x7faa6e9f1638, source=0x7faa81d9e9a8, size=16) at ../libs/libmemcpy/memcpy.h:11
|
|
|
|
#1 0x0000000005341c5f in _mm_storeu_si128 (__B=..., __P=<optimized out>) at /usr/lib/gcc/x86_64-linux-gnu/7/include/emmintrin.h:720
|
|
|
|
#2 memcpySmallAllowReadWriteOverflow15Impl (n=<optimized out>, src=<optimized out>, dst=<optimized out>) at ../dbms/src/Common/memcpySmall.h:37
|
|
|
|
|
|
|
|
add_definitions ("-fno-tree-loop-distribute-patterns")
|
|
|
|
endif ()
|
|
|
|
|
2017-01-18 15:09:10 +00:00
|
|
|
add_subdirectory (src)
|
2016-12-07 14:58:31 +00:00
|
|
|
|
2016-12-06 20:55:13 +00:00
|
|
|
set(dbms_headers)
|
|
|
|
set(dbms_sources)
|
2016-12-07 14:58:31 +00:00
|
|
|
|
2018-12-27 15:23:37 +00:00
|
|
|
include(../cmake/dbms_glob_sources.cmake)
|
2017-11-17 19:19:49 +00:00
|
|
|
|
2017-11-21 19:17:24 +00:00
|
|
|
add_headers_and_sources(clickhouse_common_io src/Common)
|
|
|
|
add_headers_and_sources(clickhouse_common_io src/Common/HashTable)
|
|
|
|
add_headers_and_sources(clickhouse_common_io src/IO)
|
2017-11-17 19:19:49 +00:00
|
|
|
|
2017-04-03 19:57:07 +00:00
|
|
|
add_headers_and_sources(dbms src/Core)
|
|
|
|
add_headers_and_sources(dbms src/DataStreams)
|
|
|
|
add_headers_and_sources(dbms src/DataTypes)
|
|
|
|
add_headers_and_sources(dbms src/Databases)
|
|
|
|
add_headers_and_sources(dbms src/Interpreters)
|
|
|
|
add_headers_and_sources(dbms src/Interpreters/ClusterProxy)
|
|
|
|
add_headers_and_sources(dbms src/Columns)
|
|
|
|
add_headers_and_sources(dbms src/Storages)
|
|
|
|
add_headers_and_sources(dbms src/Storages/Distributed)
|
2018-08-01 17:23:50 +00:00
|
|
|
add_headers_and_sources(dbms src/Storages/Kafka)
|
2017-04-03 19:57:07 +00:00
|
|
|
add_headers_and_sources(dbms src/Storages/MergeTree)
|
|
|
|
add_headers_and_sources(dbms src/Client)
|
2018-06-10 19:22:49 +00:00
|
|
|
add_headers_and_sources(dbms src/Formats)
|
2016-12-06 20:55:13 +00:00
|
|
|
|
2017-11-21 19:17:24 +00:00
|
|
|
list (APPEND clickhouse_common_io_sources ${CONFIG_BUILD})
|
|
|
|
list (APPEND clickhouse_common_io_headers ${CONFIG_VERSION} ${CONFIG_COMMON})
|
2017-03-14 13:47:39 +00:00
|
|
|
|
2017-07-25 18:20:50 +00:00
|
|
|
list (APPEND dbms_sources src/Functions/IFunction.cpp src/Functions/FunctionFactory.cpp src/Functions/FunctionHelpers.cpp)
|
2017-07-25 18:32:52 +00:00
|
|
|
list (APPEND dbms_headers src/Functions/IFunction.h src/Functions/FunctionFactory.h src/Functions/FunctionHelpers.h)
|
2017-06-10 09:04:31 +00:00
|
|
|
|
2017-05-05 20:39:25 +00:00
|
|
|
list (APPEND dbms_sources
|
|
|
|
src/AggregateFunctions/AggregateFunctionFactory.cpp
|
2017-12-24 06:50:11 +00:00
|
|
|
src/AggregateFunctions/AggregateFunctionCombinatorFactory.cpp
|
2017-12-24 10:12:49 +00:00
|
|
|
src/AggregateFunctions/AggregateFunctionState.cpp
|
2017-07-25 18:32:52 +00:00
|
|
|
src/AggregateFunctions/parseAggregateFunctionParameters.cpp)
|
2017-05-05 20:39:25 +00:00
|
|
|
|
|
|
|
list (APPEND dbms_headers
|
|
|
|
src/AggregateFunctions/IAggregateFunction.h
|
2017-12-24 06:50:11 +00:00
|
|
|
src/AggregateFunctions/IAggregateFunctionCombinator.h
|
2017-05-05 20:39:25 +00:00
|
|
|
src/AggregateFunctions/AggregateFunctionFactory.h
|
2017-12-24 06:50:11 +00:00
|
|
|
src/AggregateFunctions/AggregateFunctionCombinatorFactory.h
|
2017-12-24 10:12:49 +00:00
|
|
|
src/AggregateFunctions/AggregateFunctionState.h
|
2017-12-20 20:25:22 +00:00
|
|
|
src/AggregateFunctions/FactoryHelpers.h
|
2017-07-25 18:32:52 +00:00
|
|
|
src/AggregateFunctions/parseAggregateFunctionParameters.h)
|
2017-06-10 09:04:31 +00:00
|
|
|
|
2018-03-02 05:03:28 +00:00
|
|
|
list (APPEND dbms_sources src/TableFunctions/ITableFunction.cpp src/TableFunctions/TableFunctionFactory.cpp)
|
2017-06-10 09:04:31 +00:00
|
|
|
list (APPEND dbms_headers src/TableFunctions/ITableFunction.h src/TableFunctions/TableFunctionFactory.h)
|
2017-05-05 20:39:25 +00:00
|
|
|
|
2018-08-27 14:39:20 +00:00
|
|
|
add_library(clickhouse_common_io ${LINK_MODE} ${clickhouse_common_io_headers} ${clickhouse_common_io_sources})
|
2017-11-17 19:19:49 +00:00
|
|
|
|
2018-08-05 08:54:57 +00:00
|
|
|
if (OS_FREEBSD)
|
2018-02-27 17:17:02 +00:00
|
|
|
target_compile_definitions (clickhouse_common_io PUBLIC CLOCK_MONOTONIC_COARSE=CLOCK_MONOTONIC_FAST)
|
|
|
|
endif ()
|
|
|
|
|
2018-01-15 19:07:47 +00:00
|
|
|
add_subdirectory(src/Common/ZooKeeper)
|
2018-02-28 20:34:25 +00:00
|
|
|
add_subdirectory(src/Common/Config)
|
2018-01-15 19:07:47 +00:00
|
|
|
|
2017-03-27 12:26:24 +00:00
|
|
|
if (MAKE_STATIC_LIBRARIES)
|
2017-04-01 07:20:54 +00:00
|
|
|
add_library(dbms ${dbms_headers} ${dbms_sources})
|
2017-02-08 18:53:00 +00:00
|
|
|
else ()
|
2017-04-01 07:20:54 +00:00
|
|
|
add_library(dbms SHARED ${dbms_headers} ${dbms_sources})
|
2018-08-27 14:39:20 +00:00
|
|
|
set_target_properties (dbms PROPERTIES SOVERSION ${VERSION_MAJOR}.${VERSION_MINOR} VERSION ${VERSION_SO} OUTPUT_NAME clickhouse)
|
2017-04-10 17:43:30 +00:00
|
|
|
install (TARGETS dbms LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT clickhouse)
|
2017-02-08 18:53:00 +00:00
|
|
|
endif ()
|
2016-12-06 20:55:13 +00:00
|
|
|
|
Add a JIT interface for row-wise default-nullable functions.
Not actually implemented, though. It does print out some jit-compiled stuff,
but that's about it. For example, this query:
select number from system.numbers where something(cast(number as Float64)) == 4
results in this on server's stderr:
define double @"something(CAST(number, 'Float64'))"(void**, i8*, void*) {
"something(CAST(number, 'Float64'))":
ret double 1.234500e+04
}
(and an exception, because that's what the non-jitted method does.)
As one may notice, this function neither reads the input (first argument;
tuple of arrays) nor writes the output (third argument; array), instead
returning some general nonsense.
In addition, `#if USE_EMBEDDED_COMPILER` doesn't work for some reason,
including LLVM headers requires -Wno-unused-parameter, this probably only
works on LLVM 5.0 due to rampant API instability, and I'm definitely
no expert on CMake. In short, there's still a long way to go.
2018-04-23 22:29:39 +00:00
|
|
|
if (USE_EMBEDDED_COMPILER)
|
2018-05-29 17:54:48 +00:00
|
|
|
llvm_libs_all(REQUIRED_LLVM_LIBRARIES)
|
2018-11-21 19:20:27 +00:00
|
|
|
target_link_libraries (dbms PRIVATE ${REQUIRED_LLVM_LIBRARIES})
|
2018-06-06 20:21:58 +00:00
|
|
|
target_include_directories (dbms SYSTEM BEFORE PUBLIC ${LLVM_INCLUDE_DIRS})
|
Add a JIT interface for row-wise default-nullable functions.
Not actually implemented, though. It does print out some jit-compiled stuff,
but that's about it. For example, this query:
select number from system.numbers where something(cast(number as Float64)) == 4
results in this on server's stderr:
define double @"something(CAST(number, 'Float64'))"(void**, i8*, void*) {
"something(CAST(number, 'Float64'))":
ret double 1.234500e+04
}
(and an exception, because that's what the non-jitted method does.)
As one may notice, this function neither reads the input (first argument;
tuple of arrays) nor writes the output (third argument; array), instead
returning some general nonsense.
In addition, `#if USE_EMBEDDED_COMPILER` doesn't work for some reason,
including LLVM headers requires -Wno-unused-parameter, this probably only
works on LLVM 5.0 due to rampant API instability, and I'm definitely
no expert on CMake. In short, there's still a long way to go.
2018-04-23 22:29:39 +00:00
|
|
|
endif ()
|
|
|
|
|
2016-12-06 20:55:13 +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-04-01 07:20:54 +00:00
|
|
|
# Won't generate debug info for files with heavy template instantiation to achieve faster linking and lower size.
|
|
|
|
set_source_files_properties(
|
|
|
|
src/Dictionaries/FlatDictionary.cpp
|
|
|
|
src/Dictionaries/HashedDictionary.cpp
|
|
|
|
src/Dictionaries/CacheDictionary.cpp
|
2017-05-12 21:23:12 +00:00
|
|
|
src/Dictionaries/TrieDictionary.cpp
|
2017-04-01 07:20:54 +00:00
|
|
|
src/Dictionaries/RangeHashedDictionary.cpp
|
|
|
|
src/Dictionaries/ComplexKeyHashedDictionary.cpp
|
|
|
|
src/Dictionaries/ComplexKeyCacheDictionary.cpp
|
2017-10-24 13:30:44 +00:00
|
|
|
src/Dictionaries/ComplexKeyCacheDictionary_generate1.cpp
|
|
|
|
src/Dictionaries/ComplexKeyCacheDictionary_generate2.cpp
|
|
|
|
src/Dictionaries/ComplexKeyCacheDictionary_generate3.cpp
|
|
|
|
src/Dictionaries/ODBCBlockInputStream.cpp
|
|
|
|
src/Dictionaries/HTTPDictionarySource.cpp
|
|
|
|
src/Dictionaries/LibraryDictionarySource.cpp
|
|
|
|
src/Dictionaries/ExecutableDictionarySource.cpp
|
|
|
|
src/Dictionaries/ClickHouseDictionarySource.cpp
|
2017-04-01 07:20:54 +00:00
|
|
|
PROPERTIES COMPILE_FLAGS -g0)
|
2016-12-01 22:44:59 +00:00
|
|
|
endif ()
|
2016-03-12 05:53:04 +00:00
|
|
|
|
2018-09-28 14:53:20 +00:00
|
|
|
if (NOT ARCH_ARM AND CPUID_LIBRARY)
|
2018-06-21 17:35:03 +00:00
|
|
|
set (LINK_LIBRARIES_ONLY_ON_X86_64 ${CPUID_LIBRARY})
|
2016-12-07 14:58:31 +00:00
|
|
|
endif()
|
|
|
|
|
2017-11-21 19:17:24 +00:00
|
|
|
target_link_libraries (clickhouse_common_io
|
2018-11-21 19:20:27 +00:00
|
|
|
PUBLIC
|
2017-04-01 07:20:54 +00:00
|
|
|
common
|
2018-11-21 19:20:27 +00:00
|
|
|
PRIVATE
|
2017-11-17 19:40:27 +00:00
|
|
|
string_utils
|
2018-09-29 14:14:29 +00:00
|
|
|
widechar_width
|
2017-11-17 19:19:49 +00:00
|
|
|
${LINK_LIBRARIES_ONLY_ON_X86_64}
|
2017-04-01 07:20:54 +00:00
|
|
|
${LZ4_LIBRARY}
|
|
|
|
${ZSTD_LIBRARY}
|
2017-08-09 20:52:55 +00:00
|
|
|
${DOUBLE_CONVERSION_LIBRARIES}
|
2018-11-21 19:20:27 +00:00
|
|
|
pocoext
|
|
|
|
PUBLIC
|
2017-11-17 19:40:27 +00:00
|
|
|
${Poco_Net_LIBRARY}
|
2018-09-14 19:48:51 +00:00
|
|
|
${Poco_Util_LIBRARY}
|
|
|
|
${Poco_Foundation_LIBRARY}
|
2018-11-21 19:20:27 +00:00
|
|
|
${RE2_LIBRARY}
|
|
|
|
${RE2_ST_LIBRARY}
|
|
|
|
${CITYHASH_LIBRARIES}
|
|
|
|
PRIVATE
|
2018-01-15 18:57:10 +00:00
|
|
|
${ZLIB_LIBRARIES}
|
2017-12-13 19:07:12 +00:00
|
|
|
${EXECINFO_LIBRARY}
|
2018-05-14 21:37:56 +00:00
|
|
|
${ELF_LIBRARY}
|
2018-11-21 19:20:27 +00:00
|
|
|
PUBLIC
|
2018-01-15 18:57:10 +00:00
|
|
|
${Boost_SYSTEM_LIBRARY}
|
2018-11-21 19:20:27 +00:00
|
|
|
PRIVATE
|
2018-07-20 16:56:39 +00:00
|
|
|
apple_rt
|
2018-01-20 02:35:16 +00:00
|
|
|
${CMAKE_DL_LIBS}
|
2017-11-17 19:19:49 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries (dbms
|
2018-11-21 19:20:27 +00:00
|
|
|
PRIVATE
|
2017-11-21 19:17:24 +00:00
|
|
|
clickhouse_parsers
|
2018-02-28 20:34:25 +00:00
|
|
|
clickhouse_common_config
|
2018-11-21 19:20:27 +00:00
|
|
|
PUBLIC
|
2017-11-24 13:55:31 +00:00
|
|
|
clickhouse_common_io
|
2018-11-28 11:37:12 +00:00
|
|
|
PRIVATE
|
|
|
|
clickhouse_dictionaries
|
|
|
|
clickhouse_dictionaries_embedded
|
2018-11-21 19:20:27 +00:00
|
|
|
PUBLIC
|
2018-11-28 11:37:12 +00:00
|
|
|
pocoext
|
2017-11-17 19:19:49 +00:00
|
|
|
${MYSQLXX_LIBRARY}
|
2018-11-21 19:20:27 +00:00
|
|
|
PRIVATE
|
2017-08-09 20:52:55 +00:00
|
|
|
${BTRIE_LIBRARIES}
|
2018-08-20 15:34:37 +00:00
|
|
|
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
2018-11-21 19:20:27 +00:00
|
|
|
PUBLIC
|
|
|
|
${Boost_SYSTEM_LIBRARY}
|
2017-03-28 20:30:57 +00:00
|
|
|
)
|
|
|
|
|
2018-01-11 18:39:52 +00:00
|
|
|
if (NOT USE_INTERNAL_RE2_LIBRARY)
|
2018-06-06 20:21:58 +00:00
|
|
|
target_include_directories (dbms SYSTEM BEFORE PRIVATE ${RE2_INCLUDE_DIR})
|
2018-01-11 18:39:52 +00:00
|
|
|
endif ()
|
|
|
|
|
2018-01-15 18:57:10 +00:00
|
|
|
if (NOT USE_INTERNAL_BOOST_LIBRARY)
|
2018-06-06 20:21:58 +00:00
|
|
|
target_include_directories (clickhouse_common_io SYSTEM BEFORE PUBLIC ${Boost_INCLUDE_DIRS})
|
2018-01-15 18:57:10 +00:00
|
|
|
endif ()
|
|
|
|
|
2018-09-14 19:48:51 +00:00
|
|
|
if (Poco_SQL_FOUND AND NOT USE_INTERNAL_POCO_LIBRARY)
|
|
|
|
target_include_directories (clickhouse_common_io SYSTEM PRIVATE ${Poco_SQL_INCLUDE_DIR})
|
|
|
|
target_include_directories (dbms SYSTEM PRIVATE ${Poco_SQL_INCLUDE_DIR})
|
|
|
|
endif()
|
|
|
|
|
2018-05-14 18:36:01 +00:00
|
|
|
if (USE_POCO_SQLODBC)
|
2018-11-21 19:20:27 +00:00
|
|
|
target_link_libraries (clickhouse_common_io PRIVATE ${Poco_SQL_LIBRARY})
|
|
|
|
target_link_libraries (dbms PRIVATE ${Poco_SQLODBC_LIBRARY} ${Poco_SQL_LIBRARY})
|
2018-04-06 12:07:40 +00:00
|
|
|
if (NOT USE_INTERNAL_POCO_LIBRARY)
|
2018-09-14 19:48:51 +00:00
|
|
|
target_include_directories (clickhouse_common_io SYSTEM PRIVATE ${ODBC_INCLUDE_DIRECTORIES} ${Poco_SQL_INCLUDE_DIR})
|
|
|
|
target_include_directories (dbms SYSTEM PRIVATE ${ODBC_INCLUDE_DIRECTORIES} ${Poco_SQLODBC_INCLUDE_DIR} PUBLIC ${Poco_SQL_INCLUDE_DIR})
|
2018-04-06 12:07:40 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2018-09-14 19:48:51 +00:00
|
|
|
#if (Poco_Data_FOUND AND NOT USE_INTERNAL_POCO_LIBRARY)
|
|
|
|
if (Poco_Data_FOUND)
|
|
|
|
target_include_directories (clickhouse_common_io SYSTEM PRIVATE ${Poco_Data_INCLUDE_DIR})
|
|
|
|
target_include_directories (dbms SYSTEM PRIVATE ${Poco_Data_INCLUDE_DIR})
|
2018-04-03 11:48:40 +00:00
|
|
|
endif()
|
|
|
|
|
2018-05-14 18:36:01 +00:00
|
|
|
if (USE_POCO_DATAODBC)
|
2018-11-21 19:20:27 +00:00
|
|
|
target_link_libraries (clickhouse_common_io PRIVATE ${Poco_Data_LIBRARY})
|
|
|
|
target_link_libraries (dbms PRIVATE ${Poco_DataODBC_LIBRARY})
|
2018-04-06 12:07:40 +00:00
|
|
|
if (NOT USE_INTERNAL_POCO_LIBRARY)
|
2018-09-14 19:48:51 +00:00
|
|
|
target_include_directories (dbms SYSTEM PRIVATE ${ODBC_INCLUDE_DIRECTORIES} ${Poco_DataODBC_INCLUDE_DIR})
|
2018-04-06 12:07:40 +00:00
|
|
|
endif()
|
2017-03-28 20:30:57 +00:00
|
|
|
endif()
|
|
|
|
|
2018-05-14 18:36:01 +00:00
|
|
|
if (USE_POCO_MONGODB)
|
2018-11-21 19:20:27 +00:00
|
|
|
target_link_libraries (dbms PRIVATE ${Poco_MongoDB_LIBRARY})
|
2017-03-28 20:30:57 +00:00
|
|
|
endif()
|
|
|
|
|
2018-05-14 18:36:01 +00:00
|
|
|
if (USE_POCO_NETSSL)
|
2018-11-21 19:20:27 +00:00
|
|
|
target_link_libraries (clickhouse_common_io PRIVATE ${Poco_NetSSL_LIBRARY} ${Poco_Crypto_LIBRARY})
|
|
|
|
target_link_libraries (dbms PRIVATE ${Poco_NetSSL_LIBRARY} ${Poco_Crypto_LIBRARY})
|
2017-03-28 20:30:57 +00:00
|
|
|
endif()
|
|
|
|
|
2018-11-21 19:20:27 +00:00
|
|
|
target_link_libraries (dbms PRIVATE ${Poco_Foundation_LIBRARY})
|
2017-04-23 19:17:51 +00:00
|
|
|
|
|
|
|
if (USE_ICU)
|
2018-11-27 15:34:21 +00:00
|
|
|
target_link_libraries (dbms PRIVATE ${ICU_LIBRARIES})
|
2017-04-23 19:17:51 +00:00
|
|
|
endif ()
|
|
|
|
|
2017-10-04 00:00:22 +00:00
|
|
|
if (USE_CAPNP)
|
2018-11-21 19:20:27 +00:00
|
|
|
target_link_libraries (dbms PRIVATE ${CAPNP_LIBRARY})
|
2018-01-11 18:39:52 +00:00
|
|
|
if (NOT USE_INTERNAL_CAPNP_LIBRARY)
|
2018-06-06 20:21:58 +00:00
|
|
|
target_include_directories (dbms SYSTEM BEFORE PRIVATE ${CAPNP_INCLUDE_DIR})
|
2018-01-11 18:39:52 +00:00
|
|
|
endif ()
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (USE_RDKAFKA)
|
2018-11-21 19:20:27 +00:00
|
|
|
target_link_libraries (dbms PRIVATE ${RDKAFKA_LIBRARY})
|
2018-01-11 18:39:52 +00:00
|
|
|
if (NOT USE_INTERNAL_RDKAFKA_LIBRARY)
|
2018-06-06 20:21:58 +00:00
|
|
|
target_include_directories (dbms SYSTEM BEFORE PRIVATE ${RDKAFKA_INCLUDE_DIR})
|
2018-01-11 18:39:52 +00:00
|
|
|
endif ()
|
2017-10-04 00:00:22 +00:00
|
|
|
endif ()
|
|
|
|
|
2018-11-21 19:20:27 +00:00
|
|
|
target_link_libraries(dbms PRIVATE ${OPENSSL_CRYPTO_LIBRARY} Threads::Threads)
|
2017-02-22 14:34:36 +00:00
|
|
|
|
2018-06-06 20:21:58 +00:00
|
|
|
target_include_directories (dbms SYSTEM BEFORE PRIVATE ${DIVIDE_INCLUDE_DIR})
|
|
|
|
target_include_directories (dbms SYSTEM BEFORE PRIVATE ${SPARCEHASH_INCLUDE_DIR})
|
2018-12-05 13:24:45 +00:00
|
|
|
|
|
|
|
if (USE_HDFS)
|
|
|
|
target_link_libraries (dbms PRIVATE ${HDFS3_LIBRARY})
|
|
|
|
target_include_directories (dbms SYSTEM BEFORE PRIVATE ${HDFS3_INCLUDE_DIR})
|
|
|
|
endif()
|
2017-10-13 20:52:42 +00:00
|
|
|
|
2017-10-13 18:52:23 +00:00
|
|
|
if (NOT USE_INTERNAL_LZ4_LIBRARY)
|
2018-06-06 20:21:58 +00:00
|
|
|
target_include_directories (dbms SYSTEM BEFORE PRIVATE ${LZ4_INCLUDE_DIR})
|
2017-10-13 18:52:23 +00:00
|
|
|
endif ()
|
|
|
|
if (NOT USE_INTERNAL_ZSTD_LIBRARY)
|
2018-06-06 20:21:58 +00:00
|
|
|
target_include_directories (dbms SYSTEM BEFORE PRIVATE ${ZSTD_INCLUDE_DIR})
|
2017-10-13 18:52:23 +00:00
|
|
|
endif ()
|
2017-10-13 20:52:42 +00:00
|
|
|
|
2018-11-01 14:07:14 +00:00
|
|
|
if (USE_JEMALLOC)
|
|
|
|
target_include_directories (dbms SYSTEM BEFORE PRIVATE ${JEMALLOC_INCLUDE_DIR}) # used in Interpreters/AsynchronousMetrics.cpp
|
|
|
|
endif ()
|
|
|
|
|
2017-06-23 20:22:35 +00:00
|
|
|
target_include_directories (dbms PUBLIC ${DBMS_INCLUDE_DIR})
|
2017-11-21 19:17:24 +00:00
|
|
|
target_include_directories (clickhouse_common_io PUBLIC ${DBMS_INCLUDE_DIR})
|
2018-06-06 20:21:58 +00:00
|
|
|
target_include_directories (clickhouse_common_io SYSTEM PUBLIC ${PCG_RANDOM_INCLUDE_DIR})
|
|
|
|
target_include_directories (clickhouse_common_io SYSTEM BEFORE PUBLIC ${DOUBLE_CONVERSION_INCLUDE_DIR})
|
2017-10-14 00:53:01 +00:00
|
|
|
|
2017-11-17 19:19:49 +00:00
|
|
|
# also for copy_headers.sh:
|
2017-11-21 19:17:24 +00:00
|
|
|
target_include_directories (clickhouse_common_io BEFORE PRIVATE ${COMMON_INCLUDE_DIR})
|
2017-08-09 20:52:55 +00:00
|
|
|
|
2018-06-05 20:09:51 +00:00
|
|
|
add_subdirectory (programs)
|
2017-12-27 19:01:57 +00:00
|
|
|
add_subdirectory (tests)
|
|
|
|
|
2018-12-12 12:51:40 +00:00
|
|
|
if (GLIBC_COMPATIBILITY AND NOT CLICKHOUSE_SPLIT_BINARY)
|
|
|
|
MESSAGE(STATUS "Some symbols from glibc will be replaced for compatibility")
|
|
|
|
target_link_libraries(dbms PUBLIC glibc-compatibility)
|
|
|
|
endif()
|
|
|
|
|
2017-03-22 16:59:02 +00:00
|
|
|
if (ENABLE_TESTS)
|
2018-08-26 01:41:08 +00:00
|
|
|
macro (grep_gtest_sources BASE_DIR DST_VAR)
|
2018-01-09 17:27:02 +00:00
|
|
|
# Cold match files that are not in tests/ directories
|
|
|
|
file(GLOB_RECURSE "${DST_VAR}" RELATIVE "${BASE_DIR}" "gtest*.cpp")
|
|
|
|
endmacro()
|
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
# attach all dbms gtest sources
|
|
|
|
grep_gtest_sources(${ClickHouse_SOURCE_DIR}/dbms dbms_gtest_sources)
|
|
|
|
add_executable(unit_tests_dbms ${dbms_gtest_sources})
|
2018-11-21 19:20:27 +00:00
|
|
|
target_link_libraries(unit_tests_dbms PRIVATE gtest_main dbms clickhouse_common_zookeeper)
|
2017-04-01 07:20:54 +00:00
|
|
|
add_check(unit_tests_dbms)
|
2017-04-10 17:43:30 +00:00
|
|
|
endif ()
|