mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 10:31:57 +00:00
3ec7a4bc53
Squashed: - cmake: make sure protobuf compiler and snappy are there for unbundled build - cmake: Turn ON internal GRPC library by default until relevant features will be implemented - cmake: allow unbundled grpc Signed-off-by: Konstantin Podshumok <kpp.live+signed@gmail.com>
46 lines
1.6 KiB
CMake
46 lines
1.6 KiB
CMake
option (ENABLE_GRPC "Use gRPC" ${ENABLE_LIBRARIES})
|
|
|
|
if (NOT ENABLE_GRPC)
|
|
if (USE_INTERNAL_GRPC_LIBRARY)
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use internal gRPC library with ENABLE_GRPC=OFF")
|
|
endif()
|
|
return()
|
|
endif()
|
|
|
|
option (USE_INTERNAL_GRPC_LIBRARY
|
|
"Set to FALSE to use system gRPC library instead of bundled. (Experimental. Set to OFF on your own risk)"
|
|
${NOT_UNBUNDLED})
|
|
|
|
if (NOT USE_INTERNAL_GRPC_LIBRARY)
|
|
find_package(grpc)
|
|
if (NOT GRPC_FOUND)
|
|
find_path(GRPC_INCLUDE_DIR grpcpp/grpcpp.h)
|
|
find_library(GRPC_LIBRARY grpc++)
|
|
endif ()
|
|
|
|
if (GRPC_INCLUDE_DIR AND GRPC_LIBRARY)
|
|
set (USE_GRPC ON)
|
|
else()
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system gRPC")
|
|
endif()
|
|
endif()
|
|
|
|
if (NOT USE_GRPC)
|
|
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/grpc/include/grpc++/grpc++.h")
|
|
message (WARNING "submodule contrib/grpc is missing. To fix try run: \n git submodule update --init --recursive")
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal gRPC")
|
|
set (USE_INTERNAL_GRPC_LIBRARY OFF)
|
|
elseif (NOT USE_PROTOBUF)
|
|
message (WARNING "gRPC requires protobuf which is disabled")
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Will not use internal gRPC without protobuf")
|
|
set (USE_INTERNAL_GRPC_LIBRARY OFF)
|
|
else()
|
|
set (GRPC_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/grpc/include")
|
|
set (GRPC_LIBRARY "libgrpc++")
|
|
set (USE_GRPC ON)
|
|
set (USE_INTERNAL_GRPC_LIBRARY ON)
|
|
endif()
|
|
endif()
|
|
|
|
message (STATUS "Using gRPC=${USE_GRPC}: ${GRPC_INCLUDE_DIR} : ${GRPC_LIBRARY}")
|