From c89a8d7d1190c280a1bb3d284877189bb06658ff Mon Sep 17 00:00:00 2001 From: Yuval Lifshitz Date: Sun, 2 Feb 2020 16:14:15 +0200 Subject: [PATCH] cmake: disable kafka when not found This should fix the issue of incompatible librdkafka in ubuntu-xenial This does not apply to octopus (or newer) since ubuntu-xenial is not supported for them. Note that this change automatically changes the users build directives, which we would not like to carry forward to newer versions. Signed-off-by: Yuval Lifshitz --- src/rgw/CMakeLists.txt | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/rgw/CMakeLists.txt b/src/rgw/CMakeLists.txt index d5df1473b46..63212ca5cc6 100644 --- a/src/rgw/CMakeLists.txt +++ b/src/rgw/CMakeLists.txt @@ -123,6 +123,17 @@ set(librgw_common_srcs rgw_rest_iam.cc rgw_url.cc) +if(WITH_RADOSGW_AMQP_ENDPOINT) + find_package(RabbitMQ REQUIRED) +endif() +if(WITH_RADOSGW_KAFKA_ENDPOINT) + find_package(RDKafka 1.9.2) + if(NOT RDKafka_FOUND) + set(WITH_RADOSGW_KAFKA_ENDPOINT OFF CACHE BOOL "Rados Gateway's pubsub support for Kafka push endpoint" FORCE) + message(STATUS "Disabling Kafka endpoint support") + endif() +endif() + if(WITH_RADOSGW_AMQP_ENDPOINT) list(APPEND librgw_common_srcs rgw_amqp.cc) endif() @@ -187,13 +198,6 @@ add_dependencies(rgw_a civetweb_h) target_include_directories(rgw_a PUBLIC "${CMAKE_SOURCE_DIR}/src/dmclock/support/src") target_include_directories(rgw_a SYSTEM PUBLIC "../rapidjson/include") -if(WITH_RADOSGW_AMQP_ENDPOINT) - find_package(RabbitMQ REQUIRED) -endif() -if(WITH_RADOSGW_KAFKA_ENDPOINT) - find_package(RDKafka 0.9.2 REQUIRED) -endif() - target_link_libraries(rgw_a PRIVATE librados cls_otp_client cls_lock_client cls_rgw_client cls_refcount_client -- 2.47.3