Fix split shared build; fix build without system odbc libs (#2191)

* Fix split shared build

* Fix build without system odbc libs

* Move dbms/src/Common/iostream_debug_helpers.h -> libs/libcommon/include/common/iostream_debug_helpers.h

* Fix build with libiodbc
This commit is contained in:
proller 2018-04-09 06:52:39 -07:00 committed by GitHub
parent f02239a307
commit c26b3bdef1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 42 additions and 33 deletions

View File

@ -252,6 +252,7 @@ if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/poco/cmake/FindODBC.cmake)
else () else ()
include (cmake/find_odbc.cmake) include (cmake/find_odbc.cmake)
endif () endif ()
message (STATUS "Using odbc: ${ODBC_INCLUDE_DIRECTORIES} : ${ODBC_LIBRARIES}")
include (cmake/find_poco.cmake) include (cmake/find_poco.cmake)
include (cmake/find_lz4.cmake) include (cmake/find_lz4.cmake)
include (cmake/find_sparsehash.cmake) include (cmake/find_sparsehash.cmake)

View File

@ -51,6 +51,7 @@
set(Poco_HINTS set(Poco_HINTS
/usr/local /usr/local
/usr/local/include/Poco
C:/AppliedInformatics C:/AppliedInformatics
${Poco_DIR} ${Poco_DIR}
$ENV{Poco_DIR} $ENV{Poco_DIR}
@ -230,5 +231,3 @@ if(${Poco_OSP_FOUND})
endif() endif()
message(STATUS "Found Poco: ${Poco_LIBRARIES}") message(STATUS "Found Poco: ${Poco_LIBRARIES}")

View File

@ -52,7 +52,7 @@ elseif (NOT MISSING_INTERNAL_POCO_LIBRARY)
set (Poco_MongoDB_INCLUDE_DIRS "${ClickHouse_SOURCE_DIR}/contrib/poco/MongoDB/include/") set (Poco_MongoDB_INCLUDE_DIRS "${ClickHouse_SOURCE_DIR}/contrib/poco/MongoDB/include/")
endif () endif ()
if (ODBC_FOUND)
if (EXISTS "${ClickHouse_SOURCE_DIR}/contrib/poco/SQL/ODBC/include/") if (EXISTS "${ClickHouse_SOURCE_DIR}/contrib/poco/SQL/ODBC/include/")
set (Poco_SQL_FOUND 1) set (Poco_SQL_FOUND 1)
set (Poco_SQL_LIBRARY PocoSQL) set (Poco_SQL_LIBRARY PocoSQL)
@ -60,18 +60,25 @@ elseif (NOT MISSING_INTERNAL_POCO_LIBRARY)
"${ClickHouse_SOURCE_DIR}/contrib/poco/SQL/include" "${ClickHouse_SOURCE_DIR}/contrib/poco/SQL/include"
"${ClickHouse_SOURCE_DIR}/contrib/poco/Data/include" "${ClickHouse_SOURCE_DIR}/contrib/poco/Data/include"
) )
if (ODBC_FOUND)
set (Poco_SQLODBC_FOUND 1) set (Poco_SQLODBC_FOUND 1)
set (Poco_SQLODBC_INCLUDE_DIRS set (Poco_SQLODBC_INCLUDE_DIRS
"${ClickHouse_SOURCE_DIR}/contrib/poco/SQL/ODBC/include/" "${ClickHouse_SOURCE_DIR}/contrib/poco/SQL/ODBC/include/"
"${ClickHouse_SOURCE_DIR}/contrib/poco/Data/ODBC/include/" "${ClickHouse_SOURCE_DIR}/contrib/poco/Data/ODBC/include/"
${ODBC_INCLUDE_DIRECTORIES}
) )
set (Poco_SQLODBC_LIBRARY PocoSQLODBC ${ODBC_LIBRARIES} ${LTDL_LIBRARY}) set (Poco_SQLODBC_LIBRARY PocoSQLODBC ${ODBC_LIBRARIES} ${LTDL_LIBRARY})
endif ()
else () else ()
set (Poco_Data_FOUND 1) set (Poco_Data_FOUND 1)
set (Poco_Data_INCLUDE_DIRS "${ClickHouse_SOURCE_DIR}/contrib/poco/Data/include") set (Poco_Data_INCLUDE_DIRS "${ClickHouse_SOURCE_DIR}/contrib/poco/Data/include")
set (Poco_Data_LIBRARY PocoData) set (Poco_Data_LIBRARY PocoData)
if (ODBC_FOUND)
set (Poco_DataODBC_FOUND 1) set (Poco_DataODBC_FOUND 1)
set (Poco_DataODBC_INCLUDE_DIRS "${ClickHouse_SOURCE_DIR}/contrib/poco/Data/ODBC/include/") set (Poco_DataODBC_INCLUDE_DIRS
"${ClickHouse_SOURCE_DIR}/contrib/poco/Data/ODBC/include/"
${ODBC_INCLUDE_DIRECTORIES}
)
set (Poco_DataODBC_LIBRARY PocoDataODBC ${ODBC_LIBRARIES} ${LTDL_LIBRARY}) set (Poco_DataODBC_LIBRARY PocoDataODBC ${ODBC_LIBRARIES} ${LTDL_LIBRARY})
endif () endif ()
endif () endif ()

View File

@ -11,7 +11,7 @@
#include <IO/ReadBufferFromString.h> #include <IO/ReadBufferFromString.h>
#include <Common/Exception.h> #include <Common/Exception.h>
#include <Common/demangle.h> #include <common/demangle.h>
namespace DB namespace DB

View File

@ -3,7 +3,7 @@
#include <Core/Field.h> #include <Core/Field.h>
#include <Core/AccurateComparison.h> #include <Core/AccurateComparison.h>
#include <common/DateLUT.h> #include <common/DateLUT.h>
#include <Common/demangle.h> #include <common/demangle.h>
class SipHash; class SipHash;

View File

@ -7,7 +7,7 @@
#include <sstream> #include <sstream>
#include <Common/StackTrace.h> #include <Common/StackTrace.h>
#include <Common/demangle.h> #include <common/demangle.h>
StackTrace::StackTrace() StackTrace::StackTrace()

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include <Common/demangle.h> #include <common/demangle.h>
#include <Common/TypeList.h> #include <Common/TypeList.h>
#include <Common/Exception.h> #include <Common/Exception.h>

View File

@ -71,6 +71,3 @@ target_link_libraries (cow_columns clickhouse_common_io)
add_executable (stopwatch stopwatch.cpp) add_executable (stopwatch stopwatch.cpp)
target_link_libraries (stopwatch clickhouse_common_io) target_link_libraries (stopwatch clickhouse_common_io)
add_executable (dump_variable dump_variable.cpp)
target_link_libraries (dump_variable clickhouse_common_io)

View File

@ -6,7 +6,7 @@
#include <string> #include <string>
#include <Common/Exception.h> #include <Common/Exception.h>
#include <Common/demangle.h> #include <common/demangle.h>
namespace DB namespace DB

View File

@ -45,4 +45,4 @@ std::ostream & operator<<(std::ostream & stream, const Connection::Packet & what
} }
/// some operator<< should be declared before operator<<(... std::shared_ptr<>) /// some operator<< should be declared before operator<<(... std::shared_ptr<>)
#include <Common/iostream_debug_helpers.h> #include <common/iostream_debug_helpers.h>

View File

@ -31,7 +31,7 @@
#include <Interpreters/ExpressionActions.h> #include <Interpreters/ExpressionActions.h>
#include <Storages/IStorage.h> #include <Storages/IStorage.h>
#include <Common/typeid_cast.h> #include <Common/typeid_cast.h>
#include <TableFunctions/getStructureOfRemoteTable.h> #include <Storages/getStructureOfRemoteTable.h>
namespace DB namespace DB

View File

@ -22,7 +22,7 @@
#include <Common/ClickHouseRevision.h> #include <Common/ClickHouseRevision.h>
#include <Common/MemoryTracker.h> #include <Common/MemoryTracker.h>
#include <Common/typeid_cast.h> #include <Common/typeid_cast.h>
#include <Common/demangle.h> #include <common/demangle.h>
#include <Interpreters/config_compile.h> #include <Interpreters/config_compile.h>

View File

@ -1,4 +1,4 @@
#include <TableFunctions/getStructureOfRemoteTable.h> #include "getStructureOfRemoteTable.h"
#include <Interpreters/Cluster.h> #include <Interpreters/Cluster.h>
#include <Interpreters/Context.h> #include <Interpreters/Context.h>
#include <Interpreters/InterpreterDescribeQuery.h> #include <Interpreters/InterpreterDescribeQuery.h>

View File

@ -5,7 +5,7 @@ list(REMOVE_ITEM clickhouse_table_functions_sources ITableFunction.cpp TableFunc
list(REMOVE_ITEM clickhouse_table_functions_headers ITableFunction.h TableFunctionFactory.h) list(REMOVE_ITEM clickhouse_table_functions_headers ITableFunction.h TableFunctionFactory.h)
add_library(clickhouse_table_functions ${clickhouse_table_functions_sources}) add_library(clickhouse_table_functions ${clickhouse_table_functions_sources})
target_link_libraries(clickhouse_table_functions dbms ${Poco_Foundation_LIBRARY}) target_link_libraries(clickhouse_table_functions clickhouse_storages_system dbms ${Poco_Foundation_LIBRARY})
if (Poco_SQLODBC_FOUND) if (Poco_SQLODBC_FOUND)
target_link_libraries (clickhouse_table_functions ${Poco_SQLODBC_LIBRARY}) target_link_libraries (clickhouse_table_functions ${Poco_SQLODBC_LIBRARY})

View File

@ -1,4 +1,4 @@
#include <TableFunctions/getStructureOfRemoteTable.h> #include <Storages/getStructureOfRemoteTable.h>
#include <Storages/StorageDistributed.h> #include <Storages/StorageDistributed.h>
#include <Parsers/ASTIdentifier.h> #include <Parsers/ASTIdentifier.h>
#include <Parsers/ASTLiteral.h> #include <Parsers/ASTLiteral.h>

View File

@ -1,4 +1,4 @@
#include <TableFunctions/getStructureOfRemoteTable.h> #include <Storages/getStructureOfRemoteTable.h>
#include <Storages/StorageDistributed.h> #include <Storages/StorageDistributed.h>
#include <Parsers/ASTIdentifier.h> #include <Parsers/ASTIdentifier.h>
#include <Parsers/ASTLiteral.h> #include <Parsers/ASTLiteral.h>

View File

@ -26,6 +26,7 @@ add_library (common ${SPLIT_SHARED}
src/JSON.cpp src/JSON.cpp
src/getMemoryAmount.cpp src/getMemoryAmount.cpp
src/ThreadPool.cpp src/ThreadPool.cpp
src/demangle.cpp
include/common/Types.h include/common/Types.h
include/common/DateLUT.h include/common/DateLUT.h
@ -44,6 +45,7 @@ add_library (common ${SPLIT_SHARED}
include/common/JSON.h include/common/JSON.h
include/common/getMemoryAmount.h include/common/getMemoryAmount.h
include/common/ThreadPool.h include/common/ThreadPool.h
include/common/demangle.h
include/ext/bit_cast.h include/ext/bit_cast.h
include/ext/collection_cast.h include/ext/collection_cast.h

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include <Common/demangle.h> #include <common/demangle.h>
#include <type_traits> #include <type_traits>
#include <tuple> #include <tuple>

View File

@ -1,4 +1,4 @@
#include <Common/demangle.h> #include <common/demangle.h>
#include <cxxabi.h> #include <cxxabi.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -20,3 +20,6 @@ add_check(multi_version)
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 common) target_link_libraries (unit_tests_libcommon gtest_main common)
add_check(unit_tests_libcommon) add_check(unit_tests_libcommon)
add_executable (dump_variable dump_variable.cpp)
target_link_libraries (dump_variable clickhouse_common_io)

View File

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