mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka.git
synced 2025-11-03 03:58:04 +00:00
Require rdkafka v0.9.4 to build
This commit is contained in:
@@ -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)
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
#ifndef CPPKAFKA_CONFIG_H
|
|
||||||
#define CPPKAFKA_CONFIG_H
|
|
||||||
|
|
||||||
#cmakedefine CPPKAFKA_HAVE_OFFSET_FOR_TIMES
|
|
||||||
|
|
||||||
#endif // CPPKAFKA_CONFIG_H
|
|
||||||
@@ -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
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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());
|
||||||
|
|||||||
Reference in New Issue
Block a user