Skip to content

Commit

Permalink
bug build: fix kafka build with Conan
Browse files Browse the repository at this point in the history
Tests: протестировано CI
b31e23ba0f84ecb93567b5fc6a016b1e8a77063d

Pull Request resolved: #653
  • Loading branch information
apolukhin committed Jul 20, 2024
1 parent ae65c97 commit b40d0ac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
15 changes: 7 additions & 8 deletions conan/test_package/test_kafka.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@
#include "hello.hpp"

int main(int argc, char* argv[]) {
auto component_list =
userver::components::MinimalServerComponentList()
.Append<userver::server::handlers::Ping>()
.Append<userver::components::TestsuiteSupport>()
.Append<userver::components::HttpClient>()
.Append<userver::server::handlers::TestsControl>()
.Append<userver::components::kafka::ProducerComponent>("")
.Append<userver::components::kafka::ConsumerComponent>("");
auto component_list = userver::components::MinimalServerComponentList()
.Append<userver::server::handlers::Ping>()
.Append<userver::components::TestsuiteSupport>()
.Append<userver::components::HttpClient>()
.Append<userver::server::handlers::TestsControl>()
.Append<userver::kafka::ProducerComponent>()
.Append<userver::kafka::ConsumerComponent>();

service_template::AppendHello(component_list);

Expand Down
6 changes: 4 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class UserverConan(ConanFile):
'with_clickhouse': True,
'with_rabbitmq': True,
'with_utest': True,
'with_kafka': False,
'with_kafka': True,
'namespace': 'userver',
'namespace_begin': 'namespace userver {',
'namespace_end': '}',
Expand Down Expand Up @@ -484,7 +484,9 @@ def clickhouse():
)

def librdkafka():
return ['RdKafka::rdkafka++'] if self.options.with_kafka else []
return (
['librdkafka::librdkafka'] if self.options.with_kafka else []
)

userver_components = [
{
Expand Down

0 comments on commit b40d0ac

Please sign in to comment.