]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: disable kafka when not found 32960/head
authorYuval Lifshitz <yuvalif@yahoo.com>
Sun, 2 Feb 2020 14:14:15 +0000 (16:14 +0200)
committerYuval Lifshitz <yuvalif@yahoo.com>
Wed, 19 Feb 2020 09:45:06 +0000 (11:45 +0200)
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 <yuvalif@yahoo.com>
src/rgw/CMakeLists.txt

index d5df1473b469ad464c2cd3ea037c57eb374b77ec..63212ca5cc656b735163deb54dcb7b81eae59b2a 100644 (file)
@@ -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