Require rdkafka v0.9.4 to build

This commit is contained in:
Matias Fontanini
2017-04-16 10:29:15 -07:00
parent f924eb68e7
commit f5c8c7c3c8
5 changed files with 1 additions and 27 deletions

View File

@@ -29,18 +29,6 @@ endif()
find_package(Boost REQUIRED) find_package(Boost REQUIRED)
find_package(RdKafka REQUIRED) find_package(RdKafka REQUIRED)
if (HAVE_OFFSETS_FOR_TIMES)
message(STATUS "Enabling support for KafkaHandleBase::get_offsets_for_times")
set(CPPKAFKA_HAVE_OFFSET_FOR_TIMES ON)
else()
message(STATUS "Disabling support for KafkaHandleBase::get_offsets_for_times")
endif()
# Configuration file
configure_file(
"${PROJECT_SOURCE_DIR}/include/cppkafka/config.h.in"
"${PROJECT_SOURCE_DIR}/include/cppkafka/config.h"
)
add_subdirectory(src) add_subdirectory(src)
add_subdirectory(include) add_subdirectory(include)

View File

@@ -23,8 +23,7 @@ find_package_handle_standard_args(RDKAFKA DEFAULT_MSG
include(CheckFunctionExists) include(CheckFunctionExists)
set(CMAKE_REQUIRED_LIBRARIES ${RDKAFKA_LIBRARY}) set(CMAKE_REQUIRED_LIBRARIES ${RDKAFKA_LIBRARY})
check_function_exists(rd_kafka_committed HAVE_VALID_KAFKA_VERSION) check_function_exists(rd_kafka_offsets_for_times HAVE_VALID_KAFKA_VERSION)
check_function_exists(rd_kafka_offsets_for_times HAVE_OFFSETS_FOR_TIMES)
set(CMAKE_REQUIRED_LIBRARIES) set(CMAKE_REQUIRED_LIBRARIES)
if (HAVE_VALID_KAFKA_VERSION) if (HAVE_VALID_KAFKA_VERSION)

View File

@@ -1,6 +0,0 @@
#ifndef CPPKAFKA_CONFIG_H
#define CPPKAFKA_CONFIG_H
#cmakedefine CPPKAFKA_HAVE_OFFSET_FOR_TIMES
#endif // CPPKAFKA_CONFIG_H

View File

@@ -44,7 +44,6 @@
#include "topic_configuration.h" #include "topic_configuration.h"
#include "configuration.h" #include "configuration.h"
#include "macros.h" #include "macros.h"
#include "config.h"
namespace cppkafka { namespace cppkafka {
@@ -156,8 +155,6 @@ public:
*/ */
TopicMetadata get_metadata(const Topic& topic) const; TopicMetadata get_metadata(const Topic& topic) const;
#ifdef CPPKAFKA_HAVE_OFFSET_FOR_TIMES
/** /**
* \brief Gets topic/partition offsets based on timestamps * \brief Gets topic/partition offsets based on timestamps
* *
@@ -167,8 +164,6 @@ public:
*/ */
TopicPartitionList get_offsets_for_times(const TopicPartitionsTimestampsMap& queries) const; TopicPartitionList get_offsets_for_times(const TopicPartitionsTimestampsMap& queries) const;
#endif // CPPKAFKA_HAVE_OFFSET_FOR_TIMES
/** /**
* Returns the kafka handle name * Returns the kafka handle name
*/ */

View File

@@ -119,7 +119,6 @@ TopicMetadata KafkaHandleBase::get_metadata(const Topic& topic) const {
return topics.front(); return topics.front();
} }
#ifdef CPPKAFKA_HAVE_OFFSET_FOR_TIMES
TopicPartitionList TopicPartitionList
KafkaHandleBase::get_offsets_for_times(const TopicPartitionsTimestampsMap& queries) const { KafkaHandleBase::get_offsets_for_times(const TopicPartitionsTimestampsMap& queries) const {
TopicPartitionList topic_partitions; TopicPartitionList topic_partitions;
@@ -134,7 +133,6 @@ KafkaHandleBase::get_offsets_for_times(const TopicPartitionsTimestampsMap& queri
check_error(result); check_error(result);
return convert(topic_list_handle); return convert(topic_list_handle);
} }
#endif // CPPKAFKA_HAVE_OFFSET_FOR_TIMES
string KafkaHandleBase::get_name() const { string KafkaHandleBase::get_name() const {
return rd_kafka_name(handle_.get()); return rd_kafka_name(handle_.get());