Skip to content

Commit 08603f5

Browse files
committed
Improve for Bazel deps
1 parent 3c6197c commit 08603f5

File tree

5 files changed

+20
-4
lines changed

5 files changed

+20
-4
lines changed

BUILD renamed to BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cc_library(
55

66
includes = ["include"],
77

8-
linkopts = ["-lpthread", "-lrdkafka"],
8+
linkopts = ["-lpthread"],
99

1010
visibility = ["//visibility:public"],
1111
)
File renamed without changes.

examples/BUILD renamed to examples/BUILD.bazel

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ cc_binary(
33

44
srcs = ["kafka_sync_producer.cc"],
55

6+
linkopts = ["-lrdkafka"],
7+
68
deps = ["//:modern-cpp-kafka-api"],
79
)
810

@@ -11,6 +13,8 @@ cc_binary(
1113

1214
srcs = ["kafka_async_producer_copy_payload.cc"],
1315

16+
linkopts = ["-lrdkafka"],
17+
1418
deps = ["//:modern-cpp-kafka-api"],
1519
)
1620

@@ -19,6 +23,8 @@ cc_binary(
1923

2024
srcs = ["kafka_async_producer_not_copy_payload.cc"],
2125

26+
linkopts = ["-lrdkafka"],
27+
2228
deps = ["//:modern-cpp-kafka-api"],
2329
)
2430

@@ -27,6 +33,8 @@ cc_binary(
2733

2834
srcs = ["kafka_auto_commit_consumer.cc"],
2935

36+
linkopts = ["-lrdkafka"],
37+
3038
deps = ["//:modern-cpp-kafka-api"],
3139
)
3240

@@ -35,6 +43,8 @@ cc_binary(
3543

3644
srcs = ["kafka_manual_commit_consumer.cc"],
3745

46+
linkopts = ["-lrdkafka"],
47+
3848
deps = ["//:modern-cpp-kafka-api"],
3949
)
4050

tests/BUILD renamed to tests/BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ cc_test(
88
"@gtest//:gtest_main",
99
"@rapidjson//:rapidjson"],
1010

11+
linkopts = ["-lrdkafka"],
12+
1113
timeout = "short",
1214

1315
tags = ["unit"],
@@ -23,6 +25,8 @@ cc_test(
2325
"@gtest//:gtest",
2426
"@gtest//:gtest_main"],
2527

28+
linkopts = ["-lrdkafka"],
29+
2630
timeout = "long",
2731
shard_count = 8,
2832

@@ -38,6 +42,8 @@ cc_test(
3842
"@gtest//:gtest",
3943
"@gtest//:gtest_main"],
4044

45+
linkopts = ["-lrdkafka"],
46+
4147
timeout = "long",
4248
shard_count = 1,
4349

tools/BUILD renamed to tools/BUILD.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ cc_binary(
33

44
srcs = ["KafkaTopics.cc"],
55

6-
linkopts = ["-lboost_program_options"],
6+
linkopts = ["-lboost_program_options", "-lrdkafka"],
77

88
deps = ["//:modern-cpp-kafka-api"],
99
)
@@ -13,7 +13,7 @@ cc_binary(
1313

1414
srcs = ["KafkaConsoleConsumer.cc"],
1515

16-
linkopts = ["-lboost_program_options"],
16+
linkopts = ["-lboost_program_options", "-lrdkafka"],
1717

1818
deps = ["//:modern-cpp-kafka-api"],
1919
)
@@ -23,7 +23,7 @@ cc_binary(
2323

2424
srcs = ["KafkaConsoleProducer.cc"],
2525

26-
linkopts = ["-lboost_program_options"],
26+
linkopts = ["-lboost_program_options", "-lrdkafka"],
2727

2828
deps = ["//:modern-cpp-kafka-api"],
2929
)

0 commit comments

Comments
 (0)