Remove unbundled libpqxx support

This commit is contained in:
Azat Khuzhin 2022-01-18 00:29:27 +03:00
parent 592bc1e97d
commit a773e7ff01
11 changed files with 28 additions and 51 deletions

View File

@ -139,7 +139,6 @@ if (ENABLE_FUZZING)
set (ENABLE_CLICKHOUSE_ODBC_BRIDGE OFF)
set (ENABLE_LIBRARIES 0)
set (ENABLE_SSL 1)
set (USE_INTERNAL_SSL_LIBRARY 1)
set (USE_UNWIND ON)
set (ENABLE_EMBEDDED_COMPILER 0)
set (ENABLE_EXAMPLES 0)
@ -496,7 +495,6 @@ include (cmake/find/pdqsort.cmake)
include (cmake/find/miniselect.cmake)
include (cmake/find/curl.cmake)
include (cmake/find/s3.cmake)
include (cmake/find/libpqxx.cmake)
include (cmake/find/nlp.cmake)
include (cmake/find/filelog.cmake)
include (cmake/find/sentry.cmake)

View File

@ -1,31 +0,0 @@
option(ENABLE_LIBPQXX "Enalbe libpqxx" ${ENABLE_LIBRARIES})
if (NOT ENABLE_LIBPQXX)
return()
endif()
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/libpqxx/src")
message (WARNING "submodule contrib/libpqxx is missing. to fix try run: \n git submodule update --init")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal libpqxx library")
set (USE_LIBPQXX 0)
return()
endif()
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/libpq/include")
message (ERROR "submodule contrib/libpq is missing. to fix try run: \n git submodule update --init")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal libpq needed for libpqxx")
set (USE_LIBPQXX 0)
return()
endif()
if (NOT USE_INTERNAL_SSL_LIBRARY)
set (USE_LIBPQXX 0)
else ()
set (USE_LIBPQXX 1)
set (LIBPQXX_LIBRARY libpqxx)
set (LIBPQ_LIBRARY libpq)
set (LIBPQXX_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/libpqxx/include")
set (LIBPQ_ROOT_DIR "${ClickHouse_SOURCE_DIR}/contrib/libpq")
message (STATUS "Using libpqxx=${USE_LIBPQXX}: ${LIBPQXX_INCLUDE_DIR} : ${LIBPQXX_LIBRARY}")
message (STATUS "Using libpq: ${LIBPQ_ROOT_DIR} : ${LIBPQ_INCLUDE_DIR} : ${LIBPQ_LIBRARY}")
endif()

View File

@ -153,10 +153,8 @@ if (USE_KRB5)
endif()
if (USE_LIBPQXX)
add_subdirectory (libpq-cmake)
add_subdirectory (libpqxx-cmake)
endif()
add_subdirectory (libpqxx-cmake)
add_subdirectory (libpq-cmake)
add_subdirectory (nuraft-cmake)
add_subdirectory(fast_float-cmake)

View File

@ -1,3 +1,7 @@
if (NOT ENABLE_LIBPQXX)
return()
endif()
set(LIBPQ_SOURCE_DIR "${ClickHouse_SOURCE_DIR}/contrib/libpq")
set(SRCS
@ -60,3 +64,5 @@ target_include_directories (libpq SYSTEM PUBLIC "${LIBPQ_SOURCE_DIR}/include")
target_include_directories (libpq SYSTEM PRIVATE "${LIBPQ_SOURCE_DIR}/configs")
target_link_libraries (libpq PRIVATE ssl)
add_library(ch_contrib::libpq ALIAS libpq)

View File

@ -1,3 +1,10 @@
option(ENABLE_LIBPQXX "Enalbe libpqxx" ${ENABLE_LIBRARIES})
if (NOT ENABLE_LIBPQXX)
message(STATUS "Not using libpqxx")
return()
endif()
set (LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/libpqxx")
set (SRCS
@ -65,6 +72,7 @@ set (HDRS
add_library(libpqxx ${SRCS} ${HDRS})
target_link_libraries(libpqxx PUBLIC ${LIBPQ_LIBRARY})
target_include_directories (libpqxx SYSTEM PRIVATE "${LIBRARY_DIR}/include")
target_link_libraries(libpqxx PUBLIC ch_contrib::libpq)
target_include_directories (libpqxx SYSTEM BEFORE PUBLIC "${LIBRARY_DIR}/include")
add_library(ch_contrib::libpqxx ALIAS libpqxx)

View File

@ -98,9 +98,7 @@
#endif
#if USE_SSL
# if USE_INTERNAL_SSL_LIBRARY
# include <Compression/CompressionCodecEncrypted.h>
# endif
# include <Compression/CompressionCodecEncrypted.h>
# include <Poco/Net/Context.h>
# include <Poco/Net/SecureServerSocket.h>
#endif

View File

@ -478,9 +478,8 @@ if (TARGET ch_contrib::rocksdb)
dbms_target_link_libraries(PUBLIC ch_contrib::rocksdb)
endif()
if (USE_LIBPQXX)
dbms_target_link_libraries(PUBLIC ${LIBPQXX_LIBRARY})
dbms_target_include_directories(SYSTEM BEFORE PUBLIC ${LIBPQXX_INCLUDE_DIR})
if (TARGET ch_contrib::libpqxx)
dbms_target_link_libraries(PUBLIC ch_contrib::libpqxx)
endif()
if (USE_DATASKETCHES)

View File

@ -4,7 +4,6 @@
#cmakedefine01 USE_BASE64
#cmakedefine01 USE_SSL
#cmakedefine01 USE_INTERNAL_SSL_LIBRARY
#cmakedefine01 USE_HDFS
#cmakedefine01 USE_AWS_S3
#cmakedefine01 USE_AZURE_BLOB_STORAGE

View File

@ -9,7 +9,7 @@
#include <base/logger_useful.h>
// This depends on BoringSSL-specific API, notably <openssl/aead.h>.
#if USE_SSL && USE_INTERNAL_SSL_LIBRARY
#if USE_SSL
#include <openssl/digest.h>
#include <openssl/err.h>
#include <boost/algorithm/hex.hpp>
@ -66,7 +66,7 @@ uint8_t getMethodCode(EncryptionMethod Method)
} // end of namespace DB
#if USE_SSL && USE_INTERNAL_SSL_LIBRARY
#if USE_SSL
namespace DB
{
@ -513,7 +513,7 @@ void CompressionCodecEncrypted::doDecompressData(const char * source, UInt32 sou
}
#else /* USE_SSL && USE_INTERNAL_SSL_LIBRARY */
#else /* USE_SSL */
namespace DB
{
@ -551,7 +551,7 @@ void CompressionCodecEncrypted::Configuration::load(const Poco::Util::AbstractCo
}
#endif /* USE_SSL && USE_INTERNAL_SSL_LIBRARY */
#endif /* USE_SSL */
namespace DB
{

View File

@ -58,7 +58,6 @@ const char * auto_config_build[]
"USE_OPENCL", "@USE_OPENCL@",
"USE_LIBPQXX", "@USE_LIBPQXX@",
"USE_AZURE_BLOB_STORAGE", "@USE_AZURE_BLOB_STORAGE@",
"USE_INTERNAL_SSL_LIBRARY", "@USE_INTERNAL_SSL_LIBRARY@",
"USE_AWS_S3", "@USE_AWS_S3@",
"USE_CASSANDRA", "@USE_CASSANDRA@",
"USE_YAML_CPP", "@USE_YAML_CPP@",

View File

@ -58,3 +58,6 @@ endif()
if (TARGET ch_contrib::sqlite)
set(USE_SQLITE 1)
endif()
if (TARGET ch_contrib::libpqxx)
set(USE_LIBPQXX 1)
endif()