2017-02-06 15:15:19 +00:00
|
|
|
include(${ClickHouse_SOURCE_DIR}/cmake/dbms_include.cmake)
|
2017-01-16 19:47:11 +00:00
|
|
|
|
|
|
|
include_directories (BEFORE ${ClickHouse_SOURCE_DIR}/contrib/libdivide)
|
2017-03-02 13:34:43 +00:00
|
|
|
include_directories (BEFORE ${ClickHouse_SOURCE_DIR}/contrib/libcpuid/include)
|
2017-01-16 19:47:11 +00:00
|
|
|
include_directories (BEFORE ${ClickHouse_SOURCE_DIR}/contrib/libfarmhash)
|
|
|
|
include_directories (BEFORE ${ClickHouse_SOURCE_DIR}/contrib/libmetrohash/src)
|
2017-03-02 13:34:43 +00:00
|
|
|
include_directories (${ClickHouse_SOURCE_DIR}/libs/libdaemon/include)
|
2017-02-13 13:59:34 +00:00
|
|
|
include_directories (${ODBC_INCLUDE_DIRECTORIES})
|
2017-03-02 13:34:43 +00:00
|
|
|
include_directories (${ClickHouse_BINARY_DIR}/dbms/include)
|
2016-02-07 21:58:58 +00:00
|
|
|
|
2017-01-19 19:30:58 +00:00
|
|
|
if (NOT NO_WERROR)
|
|
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
|
|
|
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
|
|
|
|
endif ()
|
|
|
|
|
2017-02-28 23:49:04 +00:00
|
|
|
find_package (Threads)
|
|
|
|
|
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
|
|
|
add_library(string_utils
|
|
|
|
include/DB/Common/StringUtils.h
|
|
|
|
src/Common/StringUtils.cpp)
|
|
|
|
|
|
|
|
set(dbms_headers)
|
|
|
|
set(dbms_sources)
|
2016-12-07 14:58:31 +00:00
|
|
|
|
2016-12-13 11:09:22 +00:00
|
|
|
include(${ClickHouse_SOURCE_DIR}/cmake/dbms_glob_sources.cmake)
|
2016-12-06 20:55:13 +00:00
|
|
|
add_headers_and_sources(dbms Functions)
|
|
|
|
add_headers_and_sources(dbms Functions/Conditional)
|
|
|
|
add_headers_and_sources(dbms TableFunctions)
|
|
|
|
add_headers_and_sources(dbms Parsers)
|
2017-01-04 06:52:02 +00:00
|
|
|
add_headers_and_sources(dbms Analyzers)
|
2016-12-06 20:55:13 +00:00
|
|
|
add_headers_and_sources(dbms AggregateFunctions)
|
|
|
|
add_headers_and_sources(dbms Core)
|
|
|
|
add_headers_and_sources(dbms DataStreams)
|
|
|
|
add_headers_and_sources(dbms DataTypes)
|
|
|
|
add_headers_and_sources(dbms Databases)
|
|
|
|
add_headers_and_sources(dbms DataBases/Distributed)
|
|
|
|
add_headers_and_sources(dbms Dictionaries)
|
|
|
|
add_headers_and_sources(dbms Dictionaries/Embedded)
|
|
|
|
add_headers_and_sources(dbms Interpreters)
|
|
|
|
add_headers_and_sources(dbms Interpreters/ClusterProxy)
|
|
|
|
add_headers_and_sources(dbms Common)
|
|
|
|
add_headers_and_sources(dbms Common/HashTable)
|
|
|
|
add_headers_and_sources(dbms IO)
|
|
|
|
add_headers_and_sources(dbms Columns)
|
|
|
|
add_headers_and_sources(dbms Storages)
|
|
|
|
add_headers_and_sources(dbms Storages/Distributed)
|
|
|
|
add_headers_and_sources(dbms Storages/MergeTree)
|
|
|
|
add_headers_and_sources(dbms Storages/System)
|
|
|
|
add_headers_and_sources(dbms Core)
|
|
|
|
add_headers_and_sources(dbms Client)
|
|
|
|
add_headers_only(dbms Server)
|
|
|
|
|
|
|
|
list(REMOVE_ITEM dbms_sources
|
|
|
|
src/Client/Client.cpp
|
|
|
|
src/Client/Benchmark.cpp
|
|
|
|
src/Storages/StorageCloud.cpp
|
|
|
|
src/Databases/DatabaseCloud.cpp
|
2016-08-18 11:17:07 +00:00
|
|
|
src/Common/StringUtils.cpp)
|
|
|
|
|
2016-12-24 01:03:10 +00:00
|
|
|
if (APPLE OR CMAKE_SYSTEM MATCHES "FreeBSD")
|
2016-12-07 14:58:31 +00:00
|
|
|
list(REMOVE_ITEM dbms_headers
|
|
|
|
include/DB/Common/AIO.h
|
|
|
|
include/DB/IO/WriteBufferAIO.h
|
|
|
|
include/DB/IO/ReadBufferAIO.h)
|
|
|
|
list(REMOVE_ITEM dbms_sources
|
|
|
|
src/IO/ReadBufferAIO.cpp
|
|
|
|
src/IO/WriteBufferAIO.cpp)
|
2016-12-06 20:55:13 +00:00
|
|
|
endif()
|
|
|
|
|
2017-02-08 18:53:00 +00:00
|
|
|
include (${CMAKE_SOURCE_DIR}/libs/libcommon/cmake/version.cmake)
|
|
|
|
|
|
|
|
if (USE_STATIC_LIBRARIES)
|
|
|
|
add_library(dbms ${dbms_headers} ${dbms_sources})
|
|
|
|
else ()
|
|
|
|
add_library(dbms SHARED ${dbms_headers} ${dbms_sources})
|
2017-02-14 12:34:32 +00:00
|
|
|
set_target_properties (dbms PROPERTIES SOVERSION ${VERSION_MAJOR} VERSION ${VERSION_SO} OUTPUT_NAME clickhouse)
|
2017-02-08 18:53:00 +00:00
|
|
|
install (TARGETS dbms LIBRARY DESTINATION lib COMPONENT clickhouse)
|
|
|
|
endif ()
|
2016-12-06 20:55:13 +00:00
|
|
|
|
|
|
|
|
2016-08-25 14:58:01 +00:00
|
|
|
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
2016-12-01 22:44:59 +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/Functions/FunctionsArithmetic.cpp
|
|
|
|
src/Functions/FunctionsArray.cpp
|
|
|
|
src/Functions/FunctionsCoding.cpp
|
|
|
|
src/Functions/FunctionsComparison.cpp
|
|
|
|
src/Functions/FunctionsConditional.cpp
|
|
|
|
src/Functions/FunctionsConversion.cpp
|
|
|
|
src/Functions/FunctionsDateTime.cpp
|
|
|
|
src/Functions/FunctionsDictionaries.cpp
|
|
|
|
src/Functions/FunctionsFormatting.cpp
|
|
|
|
src/Functions/FunctionsHashing.cpp
|
|
|
|
src/Functions/FunctionsHigherOrder.cpp
|
|
|
|
src/Functions/FunctionsLogical.cpp
|
|
|
|
src/Functions/FunctionsRandom.cpp
|
|
|
|
src/Functions/FunctionsReinterpret.cpp
|
|
|
|
src/Functions/FunctionsRound.cpp
|
|
|
|
src/Functions/FunctionsString.cpp
|
|
|
|
src/Functions/FunctionsStringArray.cpp
|
|
|
|
src/Functions/FunctionsStringSearch.cpp
|
|
|
|
src/Functions/FunctionsURL.cpp
|
|
|
|
src/Functions/FunctionsVisitParam.cpp
|
|
|
|
src/Functions/FunctionsMath.cpp
|
|
|
|
src/Functions/FunctionsGeo.cpp
|
|
|
|
src/Functions/FunctionsMiscellaneous.cpp
|
|
|
|
src/Functions/FunctionsTransform.cpp
|
|
|
|
src/Dictionaries/FlatDictionary.cpp
|
|
|
|
src/Dictionaries/HashedDictionary.cpp
|
|
|
|
src/Dictionaries/CacheDictionary.cpp
|
|
|
|
src/Dictionaries/RangeHashedDictionary.cpp
|
|
|
|
src/Dictionaries/ComplexKeyHashedDictionary.cpp
|
|
|
|
src/Dictionaries/ComplexKeyCacheDictionary.cpp
|
|
|
|
PROPERTIES COMPILE_FLAGS -g0)
|
|
|
|
endif ()
|
2016-03-12 05:53:04 +00:00
|
|
|
|
2016-12-01 22:44:59 +00:00
|
|
|
if (NOT AARCH64)
|
|
|
|
set (LINK_LIBRARIES_ONLY_ON_X86_64 cpuid)
|
2016-12-07 14:58:31 +00:00
|
|
|
endif()
|
|
|
|
|
2016-12-24 01:03:10 +00:00
|
|
|
if (CMAKE_SYSTEM MATCHES "FreeBSD")
|
|
|
|
set(PLATFORM_LIBS "execinfo")
|
|
|
|
else()
|
|
|
|
set(PLATFORM_LIBS "")
|
|
|
|
endif()
|
|
|
|
|
2016-02-07 21:58:58 +00:00
|
|
|
target_link_libraries(dbms
|
|
|
|
common
|
|
|
|
zkutil
|
|
|
|
mysqlxx
|
|
|
|
cityhash farmhash metrohash
|
2017-02-28 23:49:04 +00:00
|
|
|
${LZ4_LIBRARY}
|
|
|
|
${ZSTD_LIBRARY}
|
2016-08-18 11:17:07 +00:00
|
|
|
string_utils
|
2017-02-28 23:49:04 +00:00
|
|
|
${DOUBLE_CONVERSION_LIBRARY}
|
2017-02-07 21:28:13 +00:00
|
|
|
${ZLIB_LIBRARIES}
|
2016-02-07 21:58:58 +00:00
|
|
|
${LINK_LIBRARIES_ONLY_ON_X86_64}
|
2017-02-28 23:49:04 +00:00
|
|
|
${RE2_LIBRARY}
|
|
|
|
${RE2_ST_LIBRARY}
|
2016-12-06 13:19:42 +00:00
|
|
|
${OPENSSL_CRYPTO_LIBRARY}
|
|
|
|
${Boost_SYSTEM_LIBRARY}
|
2017-01-13 11:25:44 +00:00
|
|
|
${Poco_Data_LIBRARY}
|
|
|
|
${Poco_DataODBC_LIBRARY}
|
|
|
|
${Poco_MongoDB_LIBRARY}
|
|
|
|
${Poco_Foundation_LIBRARY}
|
2017-02-27 21:07:57 +00:00
|
|
|
${Poco_NetSSL_LIBRARY}
|
2016-12-24 01:03:10 +00:00
|
|
|
${PLATFORM_LIBS}
|
|
|
|
${CMAKE_DL_LIBS}
|
2017-01-11 13:40:02 +00:00
|
|
|
${LTDL_LIB}
|
|
|
|
${CMAKE_THREAD_LIBS_INIT}
|
|
|
|
)
|