Remove unbundled amqpcpp support

This commit is contained in:
Azat Khuzhin 2022-01-17 22:53:36 +03:00
parent e9ec9175df
commit 3b54dfa9ad
6 changed files with 19 additions and 40 deletions

View File

@ -491,7 +491,6 @@ include (cmake/find/ltdl.cmake) # for odbc
include (cmake/find/krb5.cmake)
include (cmake/find/libgsasl.cmake)
include (cmake/find/cyrus-sasl.cmake)
include (cmake/find/amqpcpp.cmake)
include (cmake/find/capnp.cmake)
include (cmake/find/llvm.cmake)
include (cmake/find/h3.cmake)

View File

@ -1,28 +0,0 @@
if (MISSING_INTERNAL_LIBUV_LIBRARY)
message (WARNING "Can't find internal libuv needed for AMQP-CPP library")
set (ENABLE_AMQPCPP OFF CACHE INTERNAL "")
endif()
option(ENABLE_AMQPCPP "Enalbe AMQP-CPP" ${ENABLE_LIBRARIES})
if (NOT ENABLE_AMQPCPP)
return()
endif()
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/AMQP-CPP/src")
message (WARNING "submodule contrib/AMQP-CPP is missing. to fix try run: \n git submodule update --init")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal AMQP-CPP library")
set (USE_AMQPCPP 0)
return()
endif ()
set (USE_AMQPCPP 1)
set (AMQPCPP_LIBRARY amqp-cpp OpenSSL::Crypto OpenSSL::SSL)
set (AMQPCPP_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/AMQP-CPP/include")
list (APPEND AMQPCPP_INCLUDE_DIR
"${ClickHouse_SOURCE_DIR}/contrib/AMQP-CPP")
list (APPEND AMQPCPP_LIBRARY "${LIBUV_LIBRARY}")
message (STATUS "Using AMQP-CPP=${USE_AMQPCPP}: ${AMQPCPP_INCLUDE_DIR} : ${AMQPCPP_LIBRARY}")

View File

@ -148,9 +148,7 @@ if (USE_FASTOPS)
endif()
add_subdirectory (libuv-cmake)
if (USE_AMQPCPP)
add_subdirectory (amqpcpp-cmake)
endif()
add_subdirectory (amqpcpp-cmake) # requires: libuv
if (USE_CASSANDRA)
add_subdirectory (cassandra-cmake)
endif()

View File

@ -1,3 +1,10 @@
option(ENABLE_AMQPCPP "Enable AMQP-CPP" ${ENABLE_LIBRARIES})
if (NOT ENABLE_AMQPCPP)
message(STATUS "Not using AMQP-CPP")
return()
endif()
set (LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/AMQP-CPP")
set (SRCS
@ -23,9 +30,9 @@ set (SRCS
"${LIBRARY_DIR}/src/watchable.cpp"
)
add_library(amqp-cpp ${SRCS})
add_library(_amqp-cpp ${SRCS})
target_compile_options (amqp-cpp
target_compile_options (_amqp-cpp
PRIVATE
-Wno-old-style-cast
-Wno-inconsistent-missing-destructor-override
@ -40,5 +47,6 @@ target_compile_options (amqp-cpp
-w
)
target_include_directories (amqp-cpp SYSTEM PUBLIC "${LIBRARY_DIR}/include")
target_link_libraries(amqp-cpp PUBLIC OpenSSL::Crypto OpenSSL::SSL)
target_include_directories (_amqp-cpp SYSTEM BEFORE PUBLIC "${LIBRARY_DIR}/include" "${LIBRARY_DIR}")
target_link_libraries (_amqp-cpp PUBLIC OpenSSL::Crypto OpenSSL::SSL ch_contrib::uv)
add_library (ch_contrib::amqp_cpp ALIAS _amqp-cpp)

View File

@ -91,7 +91,7 @@ if (TARGET ch_contrib::rdkafka)
add_headers_and_sources(dbms Storages/Kafka)
endif()
if (USE_AMQPCPP)
if (TARGET ch_contrib::amqp_cpp)
add_headers_and_sources(dbms Storages/RabbitMQ)
endif()
@ -455,9 +455,8 @@ if (TARGET ch_contrib::snappy)
target_link_libraries (clickhouse_common_io PUBLIC ch_contrib::snappy)
endif()
if (USE_AMQPCPP)
dbms_target_link_libraries(PUBLIC ${AMQPCPP_LIBRARY})
dbms_target_include_directories (SYSTEM BEFORE PUBLIC ${AMQPCPP_INCLUDE_DIR})
if (TARGET ch_contrib::amqp_cpp)
dbms_target_link_libraries(PUBLIC ch_contrib::amqp_cpp)
endif()
if (USE_SQLITE)

View File

@ -43,3 +43,6 @@ endif()
if (TARGET ch_contrib::azure_sdk)
set(USE_AZURE_BLOB_STORAGE 1)
endif()
if (TARGET ch_contrib::amqp_cpp)
set(USE_AMQPCPP 1)
endif()