Remove unbundled msgpack support

This commit is contained in:
Azat Khuzhin 2022-01-17 23:21:37 +03:00
parent 7496ed7fde
commit a30ef87d65
6 changed files with 16 additions and 40 deletions

View File

@ -509,7 +509,6 @@ include (cmake/find/libpqxx.cmake)
include (cmake/find/yaml-cpp.cmake)
include (cmake/find/nlp.cmake)
include (cmake/find/filelog.cmake)
include (cmake/find/msgpack.cmake)
include (cmake/find/sentry.cmake)
include (cmake/find/datasketches.cmake)

View File

@ -1,37 +0,0 @@
option (ENABLE_MSGPACK "Enable msgpack library" ${ENABLE_LIBRARIES})
if(NOT ENABLE_MSGPACK)
if(USE_INTERNAL_MSGPACK_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use internal msgpack with ENABLE_MSGPACK=OFF")
endif()
return()
endif()
option (USE_INTERNAL_MSGPACK_LIBRARY "Set to FALSE to use system msgpack library instead of bundled" ON)
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/msgpack-c/include/msgpack.hpp")
if(USE_INTERNAL_MSGPACK_LIBRARY)
message(WARNING "Submodule contrib/msgpack-c is missing. To fix try run: \n git submodule update --init")
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use internal msgpack")
set(USE_INTERNAL_MSGPACK_LIBRARY 0)
endif()
set(MISSING_INTERNAL_MSGPACK_LIBRARY 1)
endif()
if(NOT USE_INTERNAL_MSGPACK_LIBRARY)
find_path(MSGPACK_INCLUDE_DIR NAMES msgpack.hpp PATHS ${MSGPACK_INCLUDE_PATHS})
if(NOT MSGPACK_INCLUDE_DIR)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system msgpack")
endif()
endif()
if(NOT MSGPACK_INCLUDE_DIR AND NOT MISSING_INTERNAL_MSGPACK_LIBRARY)
set(MSGPACK_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/msgpack-c/include")
set(USE_INTERNAL_MSGPACK_LIBRARY 1)
endif()
if (MSGPACK_INCLUDE_DIR)
set(USE_MSGPACK 1)
endif()
message(STATUS "Using msgpack=${USE_MSGPACK}: ${MSGPACK_INCLUDE_DIR}")

View File

@ -70,6 +70,7 @@ add_subdirectory (openldap-cmake)
add_subdirectory (grpc-cmake)
add_subdirectory (protobuf-cmake)
add_subdirectory (libhdfs3-cmake) # requires: protobuf
add_subdirectory (msgpack-c-cmake)
if (ENABLE_FUZZING)
add_subdirectory (libprotobuf-mutator-cmake)

View File

@ -0,0 +1,10 @@
option (ENABLE_MSGPACK "Enable msgpack library" ${ENABLE_LIBRARIES})
if(NOT ENABLE_MSGPACK)
message(STATUS "Not using msgpack")
return()
endif()
add_library(_msgpack INTERFACE)
target_include_directories(_msgpack SYSTEM BEFORE INTERFACE "${ClickHouse_SOURCE_DIR}/contrib/msgpack-c/include")
add_library(ch_contrib::msgpack ALIAS _msgpack)

View File

@ -468,8 +468,8 @@ if (USE_CASSANDRA)
dbms_target_include_directories (SYSTEM BEFORE PUBLIC ${CASS_INCLUDE_DIR})
endif()
if (USE_MSGPACK)
target_include_directories (clickhouse_common_io SYSTEM BEFORE PUBLIC ${MSGPACK_INCLUDE_DIR})
if (TARGET ch_contrib::msgpack)
target_link_libraries (clickhouse_common_io PUBLIC ch_contrib::msgpack)
endif()
target_link_libraries (clickhouse_common_io PUBLIC ${FAST_FLOAT_LIBRARY})

View File

@ -12,4 +12,7 @@ endif()
if (TARGET ch_contrib::protobuf)
set(USE_PROTOBUF 1)
endif()
if (TARGET ch_contrib::msgpack)
set(USE_MSGPACK 1)
endif()
configure_file(config_formats.h.in ${ConfigIncludePath}/config_formats.h)