mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 16:42:05 +00:00
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:
parent
f02239a307
commit
c26b3bdef1
@ -252,6 +252,7 @@ if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/poco/cmake/FindODBC.cmake)
|
||||
else ()
|
||||
include (cmake/find_odbc.cmake)
|
||||
endif ()
|
||||
message (STATUS "Using odbc: ${ODBC_INCLUDE_DIRECTORIES} : ${ODBC_LIBRARIES}")
|
||||
include (cmake/find_poco.cmake)
|
||||
include (cmake/find_lz4.cmake)
|
||||
include (cmake/find_sparsehash.cmake)
|
||||
|
@ -51,6 +51,7 @@
|
||||
|
||||
set(Poco_HINTS
|
||||
/usr/local
|
||||
/usr/local/include/Poco
|
||||
C:/AppliedInformatics
|
||||
${Poco_DIR}
|
||||
$ENV{Poco_DIR}
|
||||
@ -230,5 +231,3 @@ if(${Poco_OSP_FOUND})
|
||||
endif()
|
||||
|
||||
message(STATUS "Found Poco: ${Poco_LIBRARIES}")
|
||||
|
||||
|
||||
|
@ -52,26 +52,33 @@ elseif (NOT MISSING_INTERNAL_POCO_LIBRARY)
|
||||
set (Poco_MongoDB_INCLUDE_DIRS "${ClickHouse_SOURCE_DIR}/contrib/poco/MongoDB/include/")
|
||||
endif ()
|
||||
|
||||
if (ODBC_FOUND)
|
||||
if (EXISTS "${ClickHouse_SOURCE_DIR}/contrib/poco/SQL/ODBC/include/")
|
||||
set (Poco_SQL_FOUND 1)
|
||||
set (Poco_SQL_LIBRARY PocoSQL)
|
||||
set (Poco_SQL_INCLUDE_DIRS
|
||||
"${ClickHouse_SOURCE_DIR}/contrib/poco/SQL/include"
|
||||
"${ClickHouse_SOURCE_DIR}/contrib/poco/Data/include"
|
||||
)
|
||||
|
||||
if (EXISTS "${ClickHouse_SOURCE_DIR}/contrib/poco/SQL/ODBC/include/")
|
||||
set (Poco_SQL_FOUND 1)
|
||||
set (Poco_SQL_LIBRARY PocoSQL)
|
||||
set (Poco_SQL_INCLUDE_DIRS
|
||||
"${ClickHouse_SOURCE_DIR}/contrib/poco/SQL/include"
|
||||
"${ClickHouse_SOURCE_DIR}/contrib/poco/Data/include"
|
||||
)
|
||||
if (ODBC_FOUND)
|
||||
set (Poco_SQLODBC_FOUND 1)
|
||||
set (Poco_SQLODBC_INCLUDE_DIRS
|
||||
"${ClickHouse_SOURCE_DIR}/contrib/poco/SQL/ODBC/include/"
|
||||
"${ClickHouse_SOURCE_DIR}/contrib/poco/Data/ODBC/include/"
|
||||
${ODBC_INCLUDE_DIRECTORIES}
|
||||
)
|
||||
set (Poco_SQLODBC_LIBRARY PocoSQLODBC ${ODBC_LIBRARIES} ${LTDL_LIBRARY})
|
||||
else ()
|
||||
set (Poco_Data_FOUND 1)
|
||||
set (Poco_Data_INCLUDE_DIRS "${ClickHouse_SOURCE_DIR}/contrib/poco/Data/include")
|
||||
set (Poco_Data_LIBRARY PocoData)
|
||||
endif ()
|
||||
else ()
|
||||
set (Poco_Data_FOUND 1)
|
||||
set (Poco_Data_INCLUDE_DIRS "${ClickHouse_SOURCE_DIR}/contrib/poco/Data/include")
|
||||
set (Poco_Data_LIBRARY PocoData)
|
||||
if (ODBC_FOUND)
|
||||
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})
|
||||
endif ()
|
||||
endif ()
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include <IO/ReadBufferFromString.h>
|
||||
|
||||
#include <Common/Exception.h>
|
||||
#include <Common/demangle.h>
|
||||
#include <common/demangle.h>
|
||||
|
||||
|
||||
namespace DB
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <Core/Field.h>
|
||||
#include <Core/AccurateComparison.h>
|
||||
#include <common/DateLUT.h>
|
||||
#include <Common/demangle.h>
|
||||
#include <common/demangle.h>
|
||||
|
||||
|
||||
class SipHash;
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include <sstream>
|
||||
|
||||
#include <Common/StackTrace.h>
|
||||
#include <Common/demangle.h>
|
||||
#include <common/demangle.h>
|
||||
|
||||
|
||||
StackTrace::StackTrace()
|
||||
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <Common/demangle.h>
|
||||
#include <common/demangle.h>
|
||||
#include <Common/TypeList.h>
|
||||
#include <Common/Exception.h>
|
||||
|
||||
|
@ -71,6 +71,3 @@ target_link_libraries (cow_columns clickhouse_common_io)
|
||||
|
||||
add_executable (stopwatch stopwatch.cpp)
|
||||
target_link_libraries (stopwatch clickhouse_common_io)
|
||||
|
||||
add_executable (dump_variable dump_variable.cpp)
|
||||
target_link_libraries (dump_variable clickhouse_common_io)
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <string>
|
||||
|
||||
#include <Common/Exception.h>
|
||||
#include <Common/demangle.h>
|
||||
#include <common/demangle.h>
|
||||
|
||||
|
||||
namespace DB
|
||||
|
@ -45,4 +45,4 @@ std::ostream & operator<<(std::ostream & stream, const Connection::Packet & what
|
||||
}
|
||||
|
||||
/// some operator<< should be declared before operator<<(... std::shared_ptr<>)
|
||||
#include <Common/iostream_debug_helpers.h>
|
||||
#include <common/iostream_debug_helpers.h>
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include <Interpreters/ExpressionActions.h>
|
||||
#include <Storages/IStorage.h>
|
||||
#include <Common/typeid_cast.h>
|
||||
#include <TableFunctions/getStructureOfRemoteTable.h>
|
||||
#include <Storages/getStructureOfRemoteTable.h>
|
||||
|
||||
|
||||
namespace DB
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include <Common/ClickHouseRevision.h>
|
||||
#include <Common/MemoryTracker.h>
|
||||
#include <Common/typeid_cast.h>
|
||||
#include <Common/demangle.h>
|
||||
#include <common/demangle.h>
|
||||
#include <Interpreters/config_compile.h>
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include <TableFunctions/getStructureOfRemoteTable.h>
|
||||
#include "getStructureOfRemoteTable.h"
|
||||
#include <Interpreters/Cluster.h>
|
||||
#include <Interpreters/Context.h>
|
||||
#include <Interpreters/InterpreterDescribeQuery.h>
|
@ -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)
|
||||
|
||||
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)
|
||||
target_link_libraries (clickhouse_table_functions ${Poco_SQLODBC_LIBRARY})
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include <TableFunctions/getStructureOfRemoteTable.h>
|
||||
#include <Storages/getStructureOfRemoteTable.h>
|
||||
#include <Storages/StorageDistributed.h>
|
||||
#include <Parsers/ASTIdentifier.h>
|
||||
#include <Parsers/ASTLiteral.h>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include <TableFunctions/getStructureOfRemoteTable.h>
|
||||
#include <Storages/getStructureOfRemoteTable.h>
|
||||
#include <Storages/StorageDistributed.h>
|
||||
#include <Parsers/ASTIdentifier.h>
|
||||
#include <Parsers/ASTLiteral.h>
|
||||
|
@ -26,6 +26,7 @@ add_library (common ${SPLIT_SHARED}
|
||||
src/JSON.cpp
|
||||
src/getMemoryAmount.cpp
|
||||
src/ThreadPool.cpp
|
||||
src/demangle.cpp
|
||||
|
||||
include/common/Types.h
|
||||
include/common/DateLUT.h
|
||||
@ -44,6 +45,7 @@ add_library (common ${SPLIT_SHARED}
|
||||
include/common/JSON.h
|
||||
include/common/getMemoryAmount.h
|
||||
include/common/ThreadPool.h
|
||||
include/common/demangle.h
|
||||
|
||||
include/ext/bit_cast.h
|
||||
include/ext/collection_cast.h
|
||||
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <Common/demangle.h>
|
||||
#include <common/demangle.h>
|
||||
|
||||
#include <type_traits>
|
||||
#include <tuple>
|
@ -1,4 +1,4 @@
|
||||
#include <Common/demangle.h>
|
||||
#include <common/demangle.h>
|
||||
#include <cxxabi.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -20,3 +20,6 @@ add_check(multi_version)
|
||||
add_executable (unit_tests_libcommon gtest_json_test.cpp gtest_strong_typedef.cpp)
|
||||
target_link_libraries (unit_tests_libcommon gtest_main common)
|
||||
add_check(unit_tests_libcommon)
|
||||
|
||||
add_executable (dump_variable dump_variable.cpp)
|
||||
target_link_libraries (dump_variable clickhouse_common_io)
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include <Common/iostream_debug_helpers.h>
|
||||
#include <common/iostream_debug_helpers.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <memory>
|
Loading…
Reference in New Issue
Block a user