ClickHouse/contrib/CMakeLists.txt

159 lines
5.6 KiB
CMake
Raw Normal View History

# Third-party libraries may have substandard code.
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-result -Wno-deprecated-declarations -Wno-maybe-uninitialized -Wno-format -Wno-misleading-indentation -Wno-stringop-overflow")
2018-08-13 06:23:51 +00:00
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-old-style-cast -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-result -Wno-deprecated-declarations -Wno-non-virtual-dtor -Wno-maybe-uninitialized -Wno-format -Wno-misleading-indentation -Wno-implicit-fallthrough -std=c++1z")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wno-deprecated-declarations -Wno-format -Wno-parentheses-equality")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-old-style-cast -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wno-deprecated-declarations -Wno-non-virtual-dtor -Wno-format -std=c++1z")
endif ()
2016-08-25 21:55:02 +00:00
if (USE_INTERNAL_BOOST_LIBRARY)
add_subdirectory (boost-cmake)
endif ()
if (USE_INTERNAL_LZ4_LIBRARY)
zstd, lz4 as submodule (#1214) * Contrib: use zstd, lz4 as submodule * fix shared build * re-test me. * wip * Update CHANGELOG_RU.md * Update CHANGELOG.md * Update CHANGELOG_RU.md * Whitespaces [#CLICKHOUSE-2]. * Implemented TODO [#CLICKHOUSE-2]. * Whitespaces [#CLICKHOUSE-2]. * Remove wrong test * Implemented TODO [#CLICKHOUSE-2]. * Moved chown to correct place [#CLICKHOUSE-2]. * Resolves #1273. Exception safe users update. [#CLICKHOUSE-3] * Less noisy logging. [#CLICKHOSUE-2] * Add metrics for RWLockFIFO. [#CLICKHOUSE-3246] * Executable dictionaries: fail if program returns non zero exit code (#CLICKHOUSE-3171) * Add better logging if OPTIMIZE cannot be executed. [#CLICKHOUSE-2] * test me * Fixing documentation fragment about "default" user. It is not mandatory anymore. * append yurial/clickhouse-client to docs/interfaces * Fixed FREEZE PARTITION: using only active data parts; acquire snapshot of parts [#CLICKHOUSE-3369]. * Removed tcp_ssl_port by default [#CLICKHOUSE-2]. * Update MergeTreeDataMerger.cpp * Update ShellCommand.cpp * Disable part sendings and fetches before ALTER. [#CLICKHOUSE-3343] * Update ExecutableDictionarySource.cpp * Update ExecutableDictionarySource.cpp * Miscellaneous changes after merge [#CLICKHOUSE-2]. * Improve tests: allow redefine some values (clickhouse path, ports, ...) * Received signal Segmentation fault (#1300) (#1302) * Received signal Segmentation fault (#1300) * Add test * Tests: Use new possibly redefined values from env (in 2 tests) * Proper fix for the issue: better exception message [#CLICKHOUSE-2]. * Split GatherUtils.cpp for faster compile (#1312) * Split GatherUtils.cpp for faster compile * remove GatherUtils.cpp * Fix array writing (#1314) * changed MergedBlockOutputStream [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * disabled checkNoMultidimensionalArrays [#CLICKHOUSE-3341] * fix IMergedBlockOutputStream::writeDataImpl [#CLICKHOUSE-3341] * fix IMergedBlockOutputStream::writeDataImpl [#CLICKHOUSE-3341] * fix IMergedBlockOutputStream::writeDataImpl [#CLICKHOUSE-3341] * fix IMergedBlockOutputStream::writeDataImpl [#CLICKHOUSE-3341] * added test [#CLICKHOUSE-3341] * fixed test [#CLICKHOUSE-3341] * refactoring and comments [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * Update ColumnArray.h * Update ActionBlocker.h * Fix section tabulation * Fixed infinite recursion in expression analyzer. [#CLICKHOUSE-3125] * Update ActionBlocker.h * Improvement [#CLICKHOUSE-2]. * Try fix strange terminate (#1329) * Tests: External: rename --use_http => --no_http and fix * Try fix strange terminate * Misc [#CLICKHOUSE-2]. * Fix compile CallPointInPolygon on clang4 (Thanks to @vavrusa) (#1333) * Fix compile with boost 1.65.1+ and clang 3.8 ( https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222439 ) * Fix compile CallPointInPolygon on clang4 (Thanks to @vavrusa) * Fix complex queries with GLOBAL IN and UNION ALL (#CLICKHOUSE-3356) (#1339) * TEST only: why initQueryAnalyzer ? * Better tests * missing file * Missing file * Add test * Test fixes * Fixed FREEZE PARTITION: using only active data parts; acquire snapshot of parts [#CLICKHOUSE-3369]. * Removed tcp_ssl_port by default [#CLICKHOUSE-2]. * Better tests * comment * clean * REmove wrong code * clean * dbms: Added compression level for ZSTD. [#METR-26742] * dbms: CompressionSettingsSelector. [#METR-21516] * dbms: Minor fix. [#METR-21516] * Fix SummingMergeTree argument checking logic. This patch fixes the Nested Column Name checking logic, which allows nested columns be explicitly specified in SummingMergeTree engine.
2017-10-13 18:52:23 +00:00
add_subdirectory (lz4-cmake)
endif ()
if (USE_INTERNAL_ZSTD_LIBRARY)
zstd, lz4 as submodule (#1214) * Contrib: use zstd, lz4 as submodule * fix shared build * re-test me. * wip * Update CHANGELOG_RU.md * Update CHANGELOG.md * Update CHANGELOG_RU.md * Whitespaces [#CLICKHOUSE-2]. * Implemented TODO [#CLICKHOUSE-2]. * Whitespaces [#CLICKHOUSE-2]. * Remove wrong test * Implemented TODO [#CLICKHOUSE-2]. * Moved chown to correct place [#CLICKHOUSE-2]. * Resolves #1273. Exception safe users update. [#CLICKHOUSE-3] * Less noisy logging. [#CLICKHOSUE-2] * Add metrics for RWLockFIFO. [#CLICKHOUSE-3246] * Executable dictionaries: fail if program returns non zero exit code (#CLICKHOUSE-3171) * Add better logging if OPTIMIZE cannot be executed. [#CLICKHOUSE-2] * test me * Fixing documentation fragment about "default" user. It is not mandatory anymore. * append yurial/clickhouse-client to docs/interfaces * Fixed FREEZE PARTITION: using only active data parts; acquire snapshot of parts [#CLICKHOUSE-3369]. * Removed tcp_ssl_port by default [#CLICKHOUSE-2]. * Update MergeTreeDataMerger.cpp * Update ShellCommand.cpp * Disable part sendings and fetches before ALTER. [#CLICKHOUSE-3343] * Update ExecutableDictionarySource.cpp * Update ExecutableDictionarySource.cpp * Miscellaneous changes after merge [#CLICKHOUSE-2]. * Improve tests: allow redefine some values (clickhouse path, ports, ...) * Received signal Segmentation fault (#1300) (#1302) * Received signal Segmentation fault (#1300) * Add test * Tests: Use new possibly redefined values from env (in 2 tests) * Proper fix for the issue: better exception message [#CLICKHOUSE-2]. * Split GatherUtils.cpp for faster compile (#1312) * Split GatherUtils.cpp for faster compile * remove GatherUtils.cpp * Fix array writing (#1314) * changed MergedBlockOutputStream [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * disabled checkNoMultidimensionalArrays [#CLICKHOUSE-3341] * fix IMergedBlockOutputStream::writeDataImpl [#CLICKHOUSE-3341] * fix IMergedBlockOutputStream::writeDataImpl [#CLICKHOUSE-3341] * fix IMergedBlockOutputStream::writeDataImpl [#CLICKHOUSE-3341] * fix IMergedBlockOutputStream::writeDataImpl [#CLICKHOUSE-3341] * added test [#CLICKHOUSE-3341] * fixed test [#CLICKHOUSE-3341] * refactoring and comments [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * Update ColumnArray.h * Update ActionBlocker.h * Fix section tabulation * Fixed infinite recursion in expression analyzer. [#CLICKHOUSE-3125] * Update ActionBlocker.h * Improvement [#CLICKHOUSE-2]. * Try fix strange terminate (#1329) * Tests: External: rename --use_http => --no_http and fix * Try fix strange terminate * Misc [#CLICKHOUSE-2]. * Fix compile CallPointInPolygon on clang4 (Thanks to @vavrusa) (#1333) * Fix compile with boost 1.65.1+ and clang 3.8 ( https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222439 ) * Fix compile CallPointInPolygon on clang4 (Thanks to @vavrusa) * Fix complex queries with GLOBAL IN and UNION ALL (#CLICKHOUSE-3356) (#1339) * TEST only: why initQueryAnalyzer ? * Better tests * missing file * Missing file * Add test * Test fixes * Fixed FREEZE PARTITION: using only active data parts; acquire snapshot of parts [#CLICKHOUSE-3369]. * Removed tcp_ssl_port by default [#CLICKHOUSE-2]. * Better tests * comment * clean * REmove wrong code * clean * dbms: Added compression level for ZSTD. [#METR-26742] * dbms: CompressionSettingsSelector. [#METR-21516] * dbms: Minor fix. [#METR-21516] * Fix SummingMergeTree argument checking logic. This patch fixes the Nested Column Name checking logic, which allows nested columns be explicitly specified in SummingMergeTree engine.
2017-10-13 18:52:23 +00:00
add_subdirectory (zstd-cmake)
endif ()
if (USE_INTERNAL_RE2_LIBRARY)
2018-01-22 13:47:00 +00:00
set(RE2_BUILD_TESTING 0 CACHE INTERNAL "")
add_subdirectory (re2)
add_subdirectory (re2_st)
endif ()
if (USE_INTERNAL_DOUBLE_CONVERSION_LIBRARY)
set (BUILD_TESTING 0 CACHE INTERNAL "")
2018-01-16 17:25:25 +00:00
add_subdirectory (double-conversion)
endif ()
if (USE_INTERNAL_CITYHASH_LIBRARY)
add_subdirectory (cityhash102)
endif ()
if (USE_INTERNAL_FARMHASH_LIBRARY)
add_subdirectory (libfarmhash)
endif ()
if (USE_INTERNAL_METROHASH_LIBRARY)
add_subdirectory (libmetrohash)
endif ()
add_subdirectory (murmurhash)
if (USE_INTERNAL_BTRIE_LIBRARY)
add_subdirectory (libbtrie)
endif ()
if (USE_INTERNAL_UNWIND_LIBRARY)
add_subdirectory (libunwind)
endif ()
if (USE_INTERNAL_ZLIB_LIBRARY)
add_subdirectory (${INTERNAL_ZLIB_NAME})
# todo: make pull to Dead2/zlib-ng and remove:
# We should use same defines when including zlib.h as used when zlib compiled
target_compile_definitions (zlib PUBLIC ZLIB_COMPAT WITH_GZFILEOP)
target_compile_definitions (zlibstatic PUBLIC ZLIB_COMPAT WITH_GZFILEOP)
2017-11-30 17:09:33 +00:00
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "AMD64")
target_compile_definitions (zlib PUBLIC X86_64)
target_compile_definitions (zlibstatic PUBLIC X86_64)
endif ()
2017-11-22 12:15:17 +00:00
set_target_properties(example PROPERTIES EXCLUDE_FROM_ALL 1)
2017-11-24 19:24:07 +00:00
if (TARGET example64)
set_target_properties(example64 PROPERTIES EXCLUDE_FROM_ALL 1)
endif ()
set_target_properties(minigzip PROPERTIES EXCLUDE_FROM_ALL 1)
2017-11-24 19:24:07 +00:00
if (TARGET minigzip64)
set_target_properties(minigzip64 PROPERTIES EXCLUDE_FROM_ALL 1)
endif ()
endif ()
if (USE_INTERNAL_CCTZ_LIBRARY)
add_subdirectory (cctz-cmake)
endif ()
2016-02-07 21:58:58 +00:00
if (ENABLE_TCMALLOC AND USE_INTERNAL_GPERFTOOLS_LIBRARY)
add_subdirectory (libtcmalloc)
2016-12-01 22:44:59 +00:00
endif ()
2016-11-28 15:35:13 +00:00
if (ENABLE_JEMALLOC AND USE_INTERNAL_JEMALLOC_LIBRARY)
add_subdirectory (jemalloc-cmake)
endif ()
if (USE_INTERNAL_CPUID_LIBRARY)
add_subdirectory (libcpuid)
endif ()
if (USE_INTERNAL_SSL_LIBRARY)
if (NOT MAKE_STATIC_LIBRARIES)
set (BUILD_SHARED 1)
endif ()
set (USE_SHARED ${USE_STATIC_LIBRARIES})
2018-08-05 09:36:10 +00:00
set (LIBRESSL_SKIP_INSTALL 1)
add_subdirectory (ssl)
target_include_directories(${OPENSSL_CRYPTO_LIBRARY} SYSTEM PUBLIC ${OPENSSL_INCLUDE_DIR})
target_include_directories(${OPENSSL_SSL_LIBRARY} SYSTEM PUBLIC ${OPENSSL_INCLUDE_DIR})
endif ()
if (ENABLE_MYSQL AND USE_INTERNAL_MYSQL_LIBRARY)
add_subdirectory (mariadb-connector-c-cmake)
target_include_directories(mysqlclient PRIVATE BEFORE ${ZLIB_INCLUDE_DIR})
target_include_directories(mysqlclient PRIVATE BEFORE ${OPENSSL_INCLUDE_DIR})
endif ()
if (USE_INTERNAL_RDKAFKA_LIBRARY)
add_subdirectory (librdkafka-cmake)
target_include_directories(rdkafka PRIVATE BEFORE ${ZLIB_INCLUDE_DIR})
target_include_directories(rdkafka PRIVATE BEFORE ${OPENSSL_INCLUDE_DIR})
2017-10-13 19:24:37 +00:00
endif ()
if (ENABLE_ODBC AND USE_INTERNAL_ODBC_LIBRARY)
add_subdirectory (unixodbc-cmake)
endif ()
if (USE_INTERNAL_CAPNP_LIBRARY)
set (BUILD_TESTING 0 CACHE INTERNAL "")
set (_save ${CMAKE_CXX_EXTENSIONS})
set (CMAKE_CXX_EXTENSIONS)
add_subdirectory (capnproto/c++)
set (CMAKE_CXX_EXTENSIONS ${_save})
target_include_directories(${CAPNP_LIBRARY} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/capnproto/c++/src>)
endif ()
if (USE_INTERNAL_POCO_LIBRARY)
set (save_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
set (save_CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
set (_save ${ENABLE_TESTS})
set (ENABLE_TESTS 0)
set (CMAKE_DISABLE_FIND_PACKAGE_ZLIB 1)
if (MSVC)
set (ENABLE_DATA_ODBC 0 CACHE INTERNAL "") # TODO (build fail)
endif ()
add_subdirectory (poco)
unset (CMAKE_DISABLE_FIND_PACKAGE_ZLIB)
set (ENABLE_TESTS ${_save})
set (CMAKE_CXX_FLAGS ${save_CMAKE_CXX_FLAGS})
set (CMAKE_C_FLAGS ${save_CMAKE_C_FLAGS})
2018-05-14 17:30:30 +00:00
if (OPENSSL_FOUND AND TARGET Crypto AND (NOT DEFINED ENABLE_POCO_NETSSL OR ENABLE_POCO_NETSSL))
# Bug in poco https://github.com/pocoproject/poco/pull/2100 found on macos
target_include_directories(Crypto SYSTEM PUBLIC ${OPENSSL_INCLUDE_DIR})
2018-01-19 17:04:32 +00:00
endif ()
endif ()
if (USE_INTERNAL_LLVM_LIBRARY)
2018-07-16 14:13:15 +00:00
# ld: unknown option: --color-diagnostics
2018-08-20 16:34:28 +00:00
if (APPLE)
2018-07-16 14:13:15 +00:00
set (LINKER_SUPPORTS_COLOR_DIAGNOSTICS 0 CACHE INTERNAL "")
endif ()
add_subdirectory (llvm/llvm)
endif ()