Reorganize includes. part 1 (#921)

* Make libunwind optional. Allow use custom libcctz

* fix

* Fix

* fix

* Update BaseDaemon.cpp

* Update CMakeLists.txt

* Reorganize includes. part 1

* Update dbms_include.cmake

* Reorganize includes. part 2

* Reorganize includes. part 3

* dbms/src/Common/ThreadPool -> libs/libcommon

* Reorganize includes. part 4

* Fix print_include_directories

* Update thread_creation_latency.cpp

* Update StringRef.h
This commit is contained in:
proller 2017-06-23 23:22:35 +03:00 committed by alexey-milovidov
parent 2d359fee54
commit 4db8d09de9
67 changed files with 102 additions and 95 deletions

View File

@ -183,6 +183,7 @@ include (libs/libcommon/cmake/find_jemalloc.cmake)
include (libs/libcommon/cmake/find_cctz.cmake) include (libs/libcommon/cmake/find_cctz.cmake)
include (libs/libmysqlxx/cmake/find_mysqlclient.cmake) include (libs/libmysqlxx/cmake/find_mysqlclient.cmake)
include (libs/libdaemon/cmake/find_unwind.cmake) include (libs/libdaemon/cmake/find_unwind.cmake)
include (cmake/lib_name.cmake)
set (FULL_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}}") set (FULL_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}}")

View File

@ -1,14 +0,0 @@
include_directories (${ClickHouse_SOURCE_DIR}/dbms/src)
# for generated config_version.h and config.h:
include_directories (${ClickHouse_BINARY_DIR}/dbms/src)
# TODO:
# move code with incldes from .h to .cpp and clean this list:
include_directories (${ClickHouse_SOURCE_DIR}/libs/libcommon/include)
# for generated config_common.h:
include_directories (${ClickHouse_BINARY_DIR}/libs/libcommon/include)
include_directories (${ClickHouse_SOURCE_DIR}/libs/libpocoext/include)
include_directories (${ClickHouse_SOURCE_DIR}/libs/libzkutil/include)
include_directories (${ClickHouse_SOURCE_DIR}/libs/libmysqlxx/include)
include_directories (BEFORE ${ClickHouse_SOURCE_DIR}/contrib/libcityhash/include)

10
cmake/lib_name.cmake Normal file
View File

@ -0,0 +1,10 @@
set(CITYHASH_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/libcityhash/include)
set(CPUID_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/libcpuid/include)
set(DIVIDE_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/libdivide)
set(BTRIE_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/libbtrie/include)
set(CITYHASH_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/libcityhash/include)
set(MYSQLXX_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/libs/libmysqlxx/include)
set(POCOEXT_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/libs/libpocoext/include)
set(COMMON_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/libs/libcommon/include ${ClickHouse_BINARY_DIR}/libs/libcommon/include)
set(DBMS_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/dbms/src ${ClickHouse_BINARY_DIR}/dbms/src)

View File

@ -1,4 +1,5 @@
get_property (dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/dbms PROPERTY INCLUDE_DIRECTORIES) get_property (dirs TARGET dbms PROPERTY INCLUDE_DIRECTORIES)
list(REMOVE_DUPLICATES dirs)
file (WRITE ${CMAKE_CURRENT_BINARY_DIR}/include_directories.txt "") file (WRITE ${CMAKE_CURRENT_BINARY_DIR}/include_directories.txt "")
foreach (dir ${dirs}) foreach (dir ${dirs})
string (REPLACE "${ClickHouse_SOURCE_DIR}" "." dir "${dir}") string (REPLACE "${ClickHouse_SOURCE_DIR}" "." dir "${dir}")

View File

@ -22,7 +22,7 @@ PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:$PATH"
# Опция -mcx16 для того, чтобы выбиралось больше заголовочных файлов (с запасом). # Опция -mcx16 для того, чтобы выбиралось больше заголовочных файлов (с запасом).
for src_file in $($CLANG -M -xc++ -std=gnu++1y -Wall -Werror -msse4 -mcx16 -mpopcnt -O3 -g -fPIC \ for src_file in $($CLANG -M -xc++ -std=gnu++1z -Wall -Werror -msse4 -mcx16 -mpopcnt -O3 -g -fPIC \
$(cat "$SOURCE_PATH/build/include_directories.txt") \ $(cat "$SOURCE_PATH/build/include_directories.txt") \
"$SOURCE_PATH/dbms/src/Interpreters/SpecializedAggregator.h" | "$SOURCE_PATH/dbms/src/Interpreters/SpecializedAggregator.h" |
tr -d '\\' | tr -d '\\' |

View File

@ -14,16 +14,7 @@ get_property (BUILD_INCLUDE_DIRECTORIES DIRECTORY ${ClickHouse_SOURCE_DIR} PROPE
string (TIMESTAMP BUILD_DATE "%Y-%m-%d" UTC) string (TIMESTAMP BUILD_DATE "%Y-%m-%d" UTC)
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/src/Common/config_build.cpp.in ${CONFIG_BUILD}) configure_file (${CMAKE_CURRENT_SOURCE_DIR}/src/Common/config_build.cpp.in ${CONFIG_BUILD})
include_directories (${DBMS_INCLUDE_DIR})
include(${ClickHouse_SOURCE_DIR}/cmake/dbms_include.cmake)
include_directories (BEFORE ${ClickHouse_SOURCE_DIR}/contrib/libdivide)
include_directories (BEFORE ${ClickHouse_SOURCE_DIR}/contrib/libcpuid/include)
include_directories (BEFORE ${ClickHouse_SOURCE_DIR}/contrib/libfarmhash)
include_directories (BEFORE ${ClickHouse_SOURCE_DIR}/contrib/libmetrohash/src)
include_directories (BEFORE ${ClickHouse_SOURCE_DIR}/contrib/libbtrie/include)
include_directories (${ClickHouse_SOURCE_DIR}/libs/libdaemon/include)
include_directories (${ClickHouse_BINARY_DIR}/dbms/src)
if (NOT NO_WERROR) if (NOT NO_WERROR)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
@ -211,9 +202,14 @@ target_link_libraries (dbms
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
) )
target_include_directories (dbms target_include_directories (dbms BEFORE PRIVATE ${CPUID_INCLUDE_DIR})
INTERFACE include target_include_directories (dbms BEFORE PUBLIC ${DIVIDE_INCLUDE_DIR})
) target_include_directories (dbms BEFORE PRIVATE ${BTRIE_INCLUDE_DIR})
target_include_directories (dbms BEFORE PRIVATE ${CITYHASH_INCLUDE_DIR})
target_include_directories (dbms PUBLIC ${MYSQLXX_INCLUDE_DIR})
target_include_directories (dbms PRIVATE ${POCOEXT_INCLUDE_DIR})
target_include_directories (dbms PRIVATE ${COMMON_INCLUDE_DIR})
target_include_directories (dbms PUBLIC ${DBMS_INCLUDE_DIR})
if (ENABLE_TESTS) if (ENABLE_TESTS)
add_subdirectory (tests) add_subdirectory (tests)

View File

@ -26,3 +26,5 @@ list(REMOVE_ITEM clickhouse_aggregate_functions_headers
add_library(clickhouse_aggregate_functions ${clickhouse_aggregate_functions_sources}) add_library(clickhouse_aggregate_functions ${clickhouse_aggregate_functions_sources})
target_link_libraries(clickhouse_aggregate_functions dbms) target_link_libraries(clickhouse_aggregate_functions dbms)
target_include_directories (clickhouse_aggregate_functions BEFORE PUBLIC ${CITYHASH_INCLUDE_DIR})
target_include_directories (clickhouse_aggregate_functions PRIVATE ${COMMON_INCLUDE_DIR})

View File

@ -2,7 +2,7 @@
#include <Columns/IColumn.h> #include <Columns/IColumn.h>
#include <Columns/ColumnVector.h> #include <Columns/ColumnVector.h>
#include <Core/Defines.h>
namespace DB namespace DB
{ {

View File

@ -7,7 +7,7 @@
#include <Core/Field.h> #include <Core/Field.h>
#include <Common/Exception.h> #include <Common/Exception.h>
#include <Core/StringRef.h> #include <common/StringRef.h>
class SipHash; class SipHash;

View File

@ -15,7 +15,7 @@
#include <ext/size.h> #include <ext/size.h>
#include <Common/Arena.h> #include <Common/Arena.h>
#include <Core/StringRef.h> #include <common/StringRef.h>
#include <Core/Field.h> #include <Core/Field.h>
#include <Common/Stopwatch.h> #include <Common/Stopwatch.h>
#include <IO/ReadBufferFromFileDescriptor.h> #include <IO/ReadBufferFromFileDescriptor.h>

View File

@ -16,7 +16,7 @@
#include <IO/CompressedReadBuffer.h> #include <IO/CompressedReadBuffer.h>
#include <Common/Stopwatch.h> #include <Common/Stopwatch.h>
#include <Common/ThreadPool.h> #include <common/ThreadPool.h>
using Key = UInt64; using Key = UInt64;

View File

@ -16,7 +16,7 @@
#include <IO/CompressedReadBuffer.h> #include <IO/CompressedReadBuffer.h>
#include <Common/Stopwatch.h> #include <Common/Stopwatch.h>
#include <Common/ThreadPool.h> #include <common/ThreadPool.h>
using Key = UInt64; using Key = UInt64;

View File

@ -3,7 +3,7 @@
#include <string> #include <string>
#include <map> #include <map>
#include <Core/StringRef.h> #include <common/StringRef.h>
#include <Common/SpaceSaving.h> #include <Common/SpaceSaving.h>
int main(int argc, char ** argv) int main(int argc, char ** argv)

View File

@ -3,11 +3,9 @@
#include <IO/ReadHelpers.h> #include <IO/ReadHelpers.h>
//#include <Common/ThreadPool.h>
#include <Common/Stopwatch.h> #include <Common/Stopwatch.h>
#include <Common/Exception.h> #include <Common/Exception.h>
#include <Common/ThreadPool.h> #include <common/ThreadPool.h>
int x = 0; int x = 0;

View File

@ -1,4 +1,4 @@
#include <Common/ThreadPool.h> #include <common/ThreadPool.h>
/** Reproduces bug in ThreadPool. /** Reproduces bug in ThreadPool.
* It get stuck if we call 'wait' many times from many other threads simultaneously. * It get stuck if we call 'wait' many times from many other threads simultaneously.

View File

@ -6,7 +6,7 @@
#include <Common/Stopwatch.h> #include <Common/Stopwatch.h>
#include <Core/StringRef.h> #include <common/StringRef.h>
#include <Common/Arena.h> #include <Common/Arena.h>
#include <IO/ReadBufferFromFileDescriptor.h> #include <IO/ReadBufferFromFileDescriptor.h>

View File

@ -2,7 +2,7 @@
#include <IO/WriteBufferFromFileDescriptor.h> #include <IO/WriteBufferFromFileDescriptor.h>
#include <IO/WriteBufferFromString.h> #include <IO/WriteBufferFromString.h>
#include <IO/Operators.h> #include <IO/Operators.h>
#include <Core/StringRef.h> #include <common/StringRef.h>
/** Calculates StringRefHash from stdin. For debugging. /** Calculates StringRefHash from stdin. For debugging.

View File

@ -5,7 +5,7 @@
#include <DataStreams/IProfilingBlockInputStream.h> #include <DataStreams/IProfilingBlockInputStream.h>
#include <Common/setThreadName.h> #include <Common/setThreadName.h>
#include <Common/CurrentMetrics.h> #include <Common/CurrentMetrics.h>
#include <Common/ThreadPool.h> #include <common/ThreadPool.h>
#include <Common/MemoryTracker.h> #include <Common/MemoryTracker.h>

View File

@ -3,7 +3,7 @@
#include <Interpreters/Aggregator.h> #include <Interpreters/Aggregator.h>
#include <DataStreams/IProfilingBlockInputStream.h> #include <DataStreams/IProfilingBlockInputStream.h>
#include <Common/ConcurrentBoundedQueue.h> #include <Common/ConcurrentBoundedQueue.h>
#include <Common/ThreadPool.h> #include <common/ThreadPool.h>
#include <condition_variable> #include <condition_variable>

View File

@ -1,7 +1,7 @@
#include <iostream> #include <iostream>
#include <iomanip> #include <iomanip>
#include <Common/ThreadPool.h> #include <common/ThreadPool.h>
#include <IO/WriteBufferFromFileDescriptor.h> #include <IO/WriteBufferFromFileDescriptor.h>

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include <Common/ThreadPool.h> #include <common/ThreadPool.h>
#include <Databases/IDatabase.h> #include <Databases/IDatabase.h>

View File

@ -7,7 +7,7 @@
#include <Common/escapeForFileName.h> #include <Common/escapeForFileName.h>
#include <Common/StringUtils.h> #include <Common/StringUtils.h>
#include <Common/Stopwatch.h> #include <Common/Stopwatch.h>
#include <Common/ThreadPool.h> #include <common/ThreadPool.h>
#include <Parsers/ASTCreateQuery.h> #include <Parsers/ASTCreateQuery.h>
#include <Parsers/parseQuery.h> #include <Parsers/parseQuery.h>
#include <Parsers/ParserCreateQuery.h> #include <Parsers/ParserCreateQuery.h>

View File

@ -7,7 +7,7 @@
#include <Common/SmallObjectPool.h> #include <Common/SmallObjectPool.h>
#include <Common/HashTable/HashMap.h> #include <Common/HashTable/HashMap.h>
#include <Columns/ColumnString.h> #include <Columns/ColumnString.h>
#include <Core/StringRef.h> #include <common/StringRef.h>
#include <ext/bit_cast.h> #include <ext/bit_cast.h>
#include <Poco/RWLock.h> #include <Poco/RWLock.h>
#include <atomic> #include <atomic>

View File

@ -3,7 +3,7 @@
#include <Dictionaries/IDictionary.h> #include <Dictionaries/IDictionary.h>
#include <Dictionaries/IDictionarySource.h> #include <Dictionaries/IDictionarySource.h>
#include <Dictionaries/DictionaryStructure.h> #include <Dictionaries/DictionaryStructure.h>
#include <Core/StringRef.h> #include <common/StringRef.h>
#include <Common/HashTable/HashMap.h> #include <Common/HashTable/HashMap.h>
#include <Columns/ColumnString.h> #include <Columns/ColumnString.h>
#include <Common/Arena.h> #include <Common/Arena.h>

View File

@ -4,7 +4,7 @@
#include <vector> #include <vector>
#include <Poco/Exception.h> #include <Poco/Exception.h>
#include <common/Types.h> #include <common/Types.h>
#include <Core/StringRef.h> #include <common/StringRef.h>
/** A class that allows you to recognize by region id its text name in one of the supported languages: ru, en, ua, by, kz, tr. /** A class that allows you to recognize by region id its text name in one of the supported languages: ru, en, ua, by, kz, tr.

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include <Core/Field.h> #include <Core/Field.h>
#include <Core/StringRef.h> #include <common/StringRef.h>
#include <Core/Names.h> #include <Core/Names.h>
#include <Poco/Util/XMLConfiguration.h> #include <Poco/Util/XMLConfiguration.h>
#include <Common/PODArray.h> #include <Common/PODArray.h>

View File

@ -12,6 +12,7 @@
#include <IO/WriteIntText.h> #include <IO/WriteIntText.h>
#include <Common/formatIPv6.h> #include <Common/formatIPv6.h>
#include <iostream> #include <iostream>
#include <btrie.h>
namespace DB namespace DB

View File

@ -3,17 +3,19 @@
#include <Dictionaries/IDictionary.h> #include <Dictionaries/IDictionary.h>
#include <Dictionaries/IDictionarySource.h> #include <Dictionaries/IDictionarySource.h>
#include <Dictionaries/DictionaryStructure.h> #include <Dictionaries/DictionaryStructure.h>
#include <Core/StringRef.h> #include <common/StringRef.h>
#include <Common/HashTable/HashMap.h> #include <Common/HashTable/HashMap.h>
#include <Columns/ColumnString.h> #include <Columns/ColumnString.h>
#include <Common/Arena.h> #include <Common/Arena.h>
#include <ext/range.h> #include <ext/range.h>
#include <btrie.h>
#include <atomic> #include <atomic>
#include <memory> #include <memory>
#include <tuple> #include <tuple>
#include <common/logger_useful.h> #include <common/logger_useful.h>
struct btrie_s;
typedef struct btrie_s btrie_t;
namespace DB namespace DB
{ {

View File

@ -7,6 +7,9 @@ list(REMOVE_ITEM clickhouse_functions_headers IFunction.h FunctionFactory.h Data
add_library(clickhouse_functions ${clickhouse_functions_sources}) add_library(clickhouse_functions ${clickhouse_functions_sources})
target_link_libraries(clickhouse_functions dbms) target_link_libraries(clickhouse_functions dbms)
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)
target_include_directories (clickhouse_functions BEFORE PUBLIC ${CITYHASH_INCLUDE_DIR})
if (ENABLE_TESTS) if (ENABLE_TESTS)
add_subdirectory (tests) add_subdirectory (tests)

View File

@ -10,7 +10,7 @@
#include <Columns/ColumnConst.h> #include <Columns/ColumnConst.h>
#include <Columns/ColumnsNumber.h> #include <Columns/ColumnsNumber.h>
#include <Common/Arena.h> #include <Common/Arena.h>
#include <Core/StringRef.h> #include <common/StringRef.h>
#include <Common/HashTable/HashMap.h> #include <Common/HashTable/HashMap.h>
#include <Functions/IFunction.h> #include <Functions/IFunction.h>
#include <DataTypes/EnrichedDataTypePtr.h> #include <DataTypes/EnrichedDataTypePtr.h>

View File

@ -4,7 +4,7 @@
#include <vector> #include <vector>
#include <Common/ThreadPool.h> #include <common/ThreadPool.h>
#include <IO/WriteBuffer.h> #include <IO/WriteBuffer.h>

View File

@ -9,7 +9,7 @@
#include <Common/PODArray.h> #include <Common/PODArray.h>
#include <Common/ProfileEvents.h> #include <Common/ProfileEvents.h>
#include <Common/Exception.h> #include <Common/Exception.h>
#include <Common/unaligned.h> #include <common/unaligned.h>
#include <IO/ReadBuffer.h> #include <IO/ReadBuffer.h>
#include <IO/BufferWithOwnMemory.h> #include <IO/BufferWithOwnMemory.h>
#include <IO/CompressedStream.h> #include <IO/CompressedStream.h>

View File

@ -4,7 +4,7 @@
#include <lz4hc.h> #include <lz4hc.h>
#include <zstd.h> #include <zstd.h>
#include <Common/unaligned.h> #include <common/unaligned.h>
#include <Core/Types.h> #include <Core/Types.h>
#include <IO/CompressedWriteBuffer.h> #include <IO/CompressedWriteBuffer.h>

View File

@ -14,7 +14,7 @@
#include <common/exp10.h> #include <common/exp10.h>
#include <Core/Types.h> #include <Core/Types.h>
#include <Core/StringRef.h> #include <common/StringRef.h>
#include <Common/Exception.h> #include <Common/Exception.h>
#include <Common/StringUtils.h> #include <Common/StringUtils.h>
#include <Common/Arena.h> #include <Common/Arena.h>

View File

@ -13,7 +13,7 @@
#include <Core/Types.h> #include <Core/Types.h>
#include <Common/Exception.h> #include <Common/Exception.h>
#include <Common/StringUtils.h> #include <Common/StringUtils.h>
#include <Core/StringRef.h> #include <common/StringRef.h>
#include <IO/WriteBuffer.h> #include <IO/WriteBuffer.h>
#include <IO/WriteIntText.h> #include <IO/WriteIntText.h>

View File

@ -6,7 +6,7 @@
#include <Common/Arena.h> #include <Common/Arena.h>
#include <Common/UInt128.h> #include <Common/UInt128.h>
#include <Core/Defines.h> #include <Core/Defines.h>
#include <Core/StringRef.h> #include <common/StringRef.h>
#include <Columns/IColumn.h> #include <Columns/IColumn.h>
#include <Columns/ColumnsNumber.h> #include <Columns/ColumnsNumber.h>
#include <Columns/ColumnFixedString.h> #include <Columns/ColumnFixedString.h>

View File

@ -8,11 +8,11 @@
#include <common/logger_useful.h> #include <common/logger_useful.h>
#include <Core/StringRef.h> #include <common/StringRef.h>
#include <Common/Arena.h> #include <Common/Arena.h>
#include <Common/HashTable/HashMap.h> #include <Common/HashTable/HashMap.h>
#include <Common/HashTable/TwoLevelHashMap.h> #include <Common/HashTable/TwoLevelHashMap.h>
#include <Common/ThreadPool.h> #include <common/ThreadPool.h>
#include <DataStreams/IBlockInputStream.h> #include <DataStreams/IBlockInputStream.h>

View File

@ -13,7 +13,7 @@
#include <Core/Types.h> #include <Core/Types.h>
#include <Common/Exception.h> #include <Common/Exception.h>
#include <Common/UInt128.h> #include <Common/UInt128.h>
#include <Common/ThreadPool.h> #include <common/ThreadPool.h>
namespace DB namespace DB

View File

@ -2,7 +2,7 @@
#include <thread> #include <thread>
#include <future> #include <future>
#include <Common/ThreadPool.h> #include <common/ThreadPool.h>
#include <Poco/DirectoryIterator.h> #include <Poco/DirectoryIterator.h>
#include <Poco/FileStream.h> #include <Poco/FileStream.h>

View File

@ -30,6 +30,8 @@ target_link_libraries (hash_map_string_2 dbms)
add_executable (hash_map_string_3 hash_map_string_3.cpp) add_executable (hash_map_string_3 hash_map_string_3.cpp)
target_link_libraries (hash_map_string_3 dbms) target_link_libraries (hash_map_string_3 dbms)
target_include_directories (hash_map_string_3 BEFORE PRIVATE ${ClickHouse_SOURCE_DIR}/contrib/libfarmhash)
target_include_directories (hash_map_string_3 BEFORE PRIVATE ${ClickHouse_SOURCE_DIR}/contrib/libmetrohash/src)
add_executable (hash_map_string_small hash_map_string_small.cpp) add_executable (hash_map_string_small hash_map_string_small.cpp)
target_link_libraries (hash_map_string_small dbms) target_link_libraries (hash_map_string_small dbms)

View File

@ -15,7 +15,7 @@
#include <IO/ReadHelpers.h> #include <IO/ReadHelpers.h>
#include <Core/StringRef.h> #include <common/StringRef.h>
#include <Common/HashTable/HashMap.h> #include <Common/HashTable/HashMap.h>

View File

@ -16,7 +16,7 @@
#include <IO/ReadBufferFromFile.h> #include <IO/ReadBufferFromFile.h>
#include <IO/ReadHelpers.h> #include <IO/ReadHelpers.h>
#include <IO/CompressedReadBuffer.h> #include <IO/CompressedReadBuffer.h>
#include <Core/StringRef.h> #include <common/StringRef.h>
#include <Common/HashTable/HashMap.h> #include <Common/HashTable/HashMap.h>
#include <Interpreters/AggregationCommon.h> #include <Interpreters/AggregationCommon.h>

View File

@ -11,7 +11,7 @@
#include <IO/ReadBufferFromFile.h> #include <IO/ReadBufferFromFile.h>
#include <IO/ReadHelpers.h> #include <IO/ReadHelpers.h>
#include <IO/CompressedReadBuffer.h> #include <IO/CompressedReadBuffer.h>
#include <Core/StringRef.h> #include <common/StringRef.h>
#include <Common/HashTable/HashMap.h> #include <Common/HashTable/HashMap.h>
#include <Interpreters/AggregationCommon.h> #include <Interpreters/AggregationCommon.h>

View File

@ -14,7 +14,7 @@
#include <IO/ReadBufferFromFile.h> #include <IO/ReadBufferFromFile.h>
#include <IO/ReadHelpers.h> #include <IO/ReadHelpers.h>
#include <IO/CompressedReadBuffer.h> #include <IO/CompressedReadBuffer.h>
#include <Core/StringRef.h> #include <common/StringRef.h>
#include <Common/HashTable/HashMap.h> #include <Common/HashTable/HashMap.h>
#include <Interpreters/AggregationCommon.h> #include <Interpreters/AggregationCommon.h>

View File

@ -16,7 +16,7 @@
#include <IO/ReadBufferFromFile.h> #include <IO/ReadBufferFromFile.h>
#include <IO/ReadHelpers.h> #include <IO/ReadHelpers.h>
#include <IO/CompressedReadBuffer.h> #include <IO/CompressedReadBuffer.h>
#include <Core/StringRef.h> #include <common/StringRef.h>
#include <Common/HashTable/HashMap.h> #include <Common/HashTable/HashMap.h>
#include <Interpreters/AggregationCommon.h> #include <Interpreters/AggregationCommon.h>

View File

@ -13,7 +13,7 @@
#include <Poco/Util/Application.h> #include <Poco/Util/Application.h>
#include <Common/Stopwatch.h> #include <Common/Stopwatch.h>
#include <Common/ThreadPool.h> #include <common/ThreadPool.h>
#include <AggregateFunctions/ReservoirSampler.h> #include <AggregateFunctions/ReservoirSampler.h>
#include <boost/program_options.hpp> #include <boost/program_options.hpp>

View File

@ -12,6 +12,7 @@ add_library(clickhouse-server
StatusFile.cpp StatusFile.cpp
ReplicasStatusHandler.cpp) ReplicasStatusHandler.cpp)
target_link_libraries(clickhouse-server daemon clickhouse_storages_system clickhouse_functions clickhouse_aggregate_functions clickhouse_table_functions) target_link_libraries(clickhouse-server daemon clickhouse_storages_system clickhouse_functions clickhouse_aggregate_functions clickhouse_table_functions)
target_include_directories (clickhouse-server PUBLIC ${ClickHouse_SOURCE_DIR}/libs/libdaemon/include)
add_library(clickhouse-local LocalServer.cpp) add_library(clickhouse-local LocalServer.cpp)
target_link_libraries(clickhouse-local dbms clickhouse-server clickhouse_functions clickhouse_aggregate_functions clickhouse_table_functions) target_link_libraries(clickhouse-local dbms clickhouse-server clickhouse_functions clickhouse_aggregate_functions clickhouse_table_functions)
@ -31,6 +32,7 @@ target_link_libraries (clickhouse-performance-test dbms ${Boost_PROGRAM_OPTIONS_
add_executable(clickhouse main.cpp) add_executable(clickhouse main.cpp)
target_include_directories(clickhouse PRIVATE ${COMMON_INCLUDE_DIR})
target_link_libraries(clickhouse target_link_libraries(clickhouse
clickhouse-server clickhouse-server
clickhouse-client clickhouse-client

View File

@ -14,7 +14,7 @@
#include <Client/Connection.h> #include <Client/Connection.h>
#include <Common/ConcurrentBoundedQueue.h> #include <Common/ConcurrentBoundedQueue.h>
#include <Common/Stopwatch.h> #include <Common/Stopwatch.h>
#include <Common/ThreadPool.h> #include <common/ThreadPool.h>
#include <Common/getFQDNOrHostName.h> #include <Common/getFQDNOrHostName.h>
#include <Common/getNumberOfPhysicalCPUCores.h> #include <Common/getNumberOfPhysicalCPUCores.h>
#include <Core/Types.h> #include <Core/Types.h>

View File

@ -22,7 +22,7 @@
#include <Interpreters/Context.h> #include <Interpreters/Context.h>
#include <Interpreters/Cluster.h> #include <Interpreters/Cluster.h>
#include <Common/ThreadPool.h> #include <common/ThreadPool.h>
#include <Common/ZooKeeper/ZooKeeper.h> #include <Common/ZooKeeper/ZooKeeper.h>

View File

@ -37,7 +37,7 @@
#include <Poco/DirectoryIterator.h> #include <Poco/DirectoryIterator.h>
#include <Common/ThreadPool.h> #include <common/ThreadPool.h>
#include <ext/range.h> #include <ext/range.h>
#include <ext/scope_guard.h> #include <ext/scope_guard.h>

View File

@ -1,7 +1,5 @@
include_directories (include) include_directories (include)
include(${ClickHouse_SOURCE_DIR}/cmake/dbms_include.cmake)
if (APPLE) if (APPLE)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin" AND NOT "${CMAKE_SYSTEM_VERSION}" VERSION_LESS "16.1.0") if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin" AND NOT "${CMAKE_SYSTEM_VERSION}" VERSION_LESS "16.1.0")
set (APPLE_SIERRA_OR_NEWER 1) set (APPLE_SIERRA_OR_NEWER 1)
@ -26,6 +24,7 @@ add_library (common
src/exp10.cpp src/exp10.cpp
src/JSON.cpp src/JSON.cpp
src/getMemoryAmount.cpp src/getMemoryAmount.cpp
src/ThreadPool.cpp
src/iostream_debug_helpers.cpp src/iostream_debug_helpers.cpp
include/common/ApplicationServerExt.h include/common/ApplicationServerExt.h
@ -43,6 +42,7 @@ add_library (common
include/common/strong_typedef.h include/common/strong_typedef.h
include/common/JSON.h include/common/JSON.h
include/common/getMemoryAmount.h include/common/getMemoryAmount.h
include/common/ThreadPool.h
include/common/iostream_debug_helpers.h include/common/iostream_debug_helpers.h
include/ext/bit_cast.h include/ext/bit_cast.h
@ -78,7 +78,9 @@ endif ()
find_package (Threads) find_package (Threads)
target_include_directories (common PRIVATE ${CCTZ_INCLUDE_DIR}) target_include_directories (common BEFORE PRIVATE ${CCTZ_INCLUDE_DIR})
target_include_directories (common BEFORE PUBLIC ${CITYHASH_INCLUDE_DIR})
target_include_directories (common BEFORE PUBLIC ${COMMON_INCLUDE_DIR})
target_link_libraries ( target_link_libraries (
common common

View File

@ -2,13 +2,17 @@
#include <common/DateLUTImpl.h> #include <common/DateLUTImpl.h>
#include <common/singleton.h> #include <common/singleton.h>
#include <Core/Defines.h>
#include <unordered_map> #include <unordered_map>
#include <atomic> #include <atomic>
#include <mutex> #include <mutex>
#include <memory> #include <memory>
// Also defined in Core/Defines.h
#if !defined(ALWAYS_INLINE)
#define ALWAYS_INLINE __attribute__((__always_inline__))
#endif
/// This class provides lazy initialization and lookup of singleton DateLUTImpl objects for a given timezone. /// This class provides lazy initialization and lookup of singleton DateLUTImpl objects for a given timezone.
class DateLUT : public Singleton<DateLUT> class DateLUT : public Singleton<DateLUT>

View File

@ -2,7 +2,7 @@
#include <typeinfo> #include <typeinfo>
#include <Poco/Exception.h> #include <Poco/Exception.h>
#include <Core/StringRef.h> #include <common/StringRef.h>
#include <common/Types.h> #include <common/Types.h>

View File

@ -5,14 +5,15 @@
#include <functional> #include <functional>
#include <ostream> #include <ostream>
#include <common/Types.h>
#include <common/unaligned.h>
#include <city.h>
#if __SSE2__ #if __SSE2__
#include <emmintrin.h> #include <emmintrin.h>
#endif #endif
#include <city.h>
#include <Core/Types.h>
#include <Common/unaligned.h>
/// The thing to avoid creating strings to find substrings in the hash table. /// The thing to avoid creating strings to find substrings in the hash table.
@ -33,7 +34,6 @@ struct StringRef
using StringRefs = std::vector<StringRef>; using StringRefs = std::vector<StringRef>;
using UInt64 = DB::UInt64;
#if __SSE2__ #if __SSE2__

View File

@ -1,6 +1,5 @@
#pragma once #pragma once
#include <Core/Defines.h>
#include <string.h> #include <string.h>

View File

@ -1,4 +1,4 @@
#include <Common/ThreadPool.h> #include <common/ThreadPool.h>
#include <iostream> #include <iostream>

View File

@ -16,7 +16,7 @@ target_link_libraries (date_lut2 common ${PLATFORM_LIBS})
target_link_libraries (date_lut3 common ${PLATFORM_LIBS}) target_link_libraries (date_lut3 common ${PLATFORM_LIBS})
target_link_libraries (date_lut4 common ${PLATFORM_LIBS}) target_link_libraries (date_lut4 common ${PLATFORM_LIBS})
target_link_libraries (date_lut_default_timezone common ${PLATFORM_LIBS}) target_link_libraries (date_lut_default_timezone common ${PLATFORM_LIBS})
target_link_libraries (multi_version dbms ${Boost_SYSTEM_LIBRARY} ${RT_LIBRARIES}) target_link_libraries (multi_version common ${Boost_SYSTEM_LIBRARY} ${RT_LIBRARIES})
add_executable (unit_tests_libcommon gtest_json_test.cpp gtest_strong_typedef.cpp) add_executable (unit_tests_libcommon gtest_json_test.cpp gtest_strong_typedef.cpp)
target_link_libraries (unit_tests_libcommon gtest_main) target_link_libraries (unit_tests_libcommon gtest_main)

View File

@ -1,6 +1,6 @@
#include <string.h> #include <string.h>
#include <iostream> #include <iostream>
#include <Common/ThreadPool.h> #include <common/ThreadPool.h>
#include <functional> #include <functional>
#include <common/MultiVersion.h> #include <common/MultiVersion.h>
#include <Poco/Exception.h> #include <Poco/Exception.h>

View File

@ -1,5 +1,4 @@
include_directories (include) include_directories (include)
include(${ClickHouse_SOURCE_DIR}/cmake/dbms_include.cmake)
add_library (daemon add_library (daemon
src/BaseDaemon.cpp src/BaseDaemon.cpp
@ -16,4 +15,6 @@ if (USE_UNWIND)
add_definitions(-DUSE_UNWIND=1) add_definitions(-DUSE_UNWIND=1)
target_link_libraries (daemon ${UNWIND_LIBRARY}) target_link_libraries (daemon ${UNWIND_LIBRARY})
endif () endif ()
target_link_libraries (daemon dbms) target_link_libraries (daemon dbms)
target_include_directories (daemon PRIVATE ${ClickHouse_SOURCE_DIR}/libs/libpocoext/include)

View File

@ -1,6 +1,5 @@
include_directories (include) include_directories (include)
include_directories (${ClickHouse_SOURCE_DIR}/libs/libcommon/include) include_directories (${ClickHouse_SOURCE_DIR}/libs/libcommon/include)
include(${ClickHouse_SOURCE_DIR}/cmake/dbms_include.cmake)
add_library (mysqlxx add_library (mysqlxx
src/Connection.cpp src/Connection.cpp

View File

@ -3,6 +3,6 @@ include_directories (${CMAKE_CURRENT_BINARY_DIR})
add_executable (mysqlxx_test mysqlxx_test.cpp) add_executable (mysqlxx_test mysqlxx_test.cpp)
add_executable (failover failover.cpp) add_executable (failover failover.cpp)
target_link_libraries (mysqlxx_test mysqlxx dbms ${RT_LIBRARIES}) target_link_libraries (mysqlxx_test mysqlxx ${RT_LIBRARIES})
target_link_libraries (failover mysqlxx ${Poco_Util_LIBRARY} ${Poco_Foundation_LIBRARY}) target_link_libraries (failover mysqlxx ${Poco_Util_LIBRARY} ${Poco_Foundation_LIBRARY})
target_link_rt_by_force (failover) target_link_rt_by_force (failover)

View File

@ -1,5 +1,3 @@
include(${ClickHouse_SOURCE_DIR}/cmake/dbms_include.cmake)
if (NOT NO_WERROR) if (NOT NO_WERROR)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")

View File

@ -14,7 +14,7 @@
#include <Common/Exception.h> #include <Common/Exception.h>
#include <Common/ThreadPool.h> #include <common/ThreadPool.h>
#include <Common/Stopwatch.h> #include <Common/Stopwatch.h>
#include <cstdlib> #include <cstdlib>

View File

@ -13,7 +13,7 @@
#include <Common/Exception.h> #include <Common/Exception.h>
#include <Common/ThreadPool.h> #include <common/ThreadPool.h>
#include <Common/Stopwatch.h> #include <Common/Stopwatch.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -20,7 +20,7 @@
#include <Common/Exception.h> #include <Common/Exception.h>
#include <Common/ThreadPool.h> #include <common/ThreadPool.h>
#include <Common/Stopwatch.h> #include <Common/Stopwatch.h>
#ifdef __APPLE__ #ifdef __APPLE__

View File

@ -4,7 +4,7 @@
#include <Common/HashTable/HashMap.h> #include <Common/HashTable/HashMap.h>
#include <Common/Arena.h> #include <Common/Arena.h>
#include <ext/bit_cast.h> #include <ext/bit_cast.h>
#include <Core/StringRef.h> #include <common/StringRef.h>
namespace DB namespace DB