Skip to content

Commit 37e5081

Browse files
committed
gRPC depends abseil-cp, so we always enable abseil-cpp when have WITH_OTLP_GRPC
1 parent 5c5f9b7 commit 37e5081

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ if(WITH_PROMETHEUS)
363363
endif()
364364
endif()
365365

366-
if(WITH_ABSEIL)
366+
if(WITH_ABSEIL OR WITH_OTLP_GRPC)
367367
if(NOT TARGET absl::strings)
368368
find_package(absl CONFIG REQUIRED)
369369
endif()
@@ -374,7 +374,7 @@ if(WITH_OTLP_GRPC
374374
OR WITH_OTLP_FILE)
375375
find_package(Protobuf)
376376
if(Protobuf_VERSION AND Protobuf_VERSION VERSION_GREATER_EQUAL "3.22.0")
377-
if(NOT WITH_ABSEIL)
377+
if(NOT WITH_ABSEIL AND NOT WITH_OTLP_GRPC)
378378
message(
379379
FATAL_ERROR
380380
"Protobuf 3.22 or upper require abseil-cpp(Recommended version: 20230125 or upper)"

api/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ if(WITH_NO_DEPRECATED_CODE)
3535
INTERFACE OPENTELEMETRY_NO_DEPRECATED_CODE)
3636
endif()
3737

38-
if(WITH_ABSEIL)
38+
if(WITH_ABSEIL OR WITH_OTLP_GRPC)
3939
target_compile_definitions(opentelemetry_api INTERFACE HAVE_ABSEIL)
4040
target_link_libraries(
4141
opentelemetry_api INTERFACE absl::bad_variant_access absl::any absl::base

exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_client.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,18 @@
1313

1414
#include "opentelemetry/exporters/otlp/otlp_grpc_client_options.h"
1515

16+
// clang-format off
1617
#include "opentelemetry/exporters/otlp/protobuf_include_prefix.h"
18+
// clang-format on
1719

1820
#include "google/protobuf/arena.h"
1921
#include "opentelemetry/proto/collector/logs/v1/logs_service.grpc.pb.h"
2022
#include "opentelemetry/proto/collector/metrics/v1/metrics_service.grpc.pb.h"
2123
#include "opentelemetry/proto/collector/trace/v1/trace_service.grpc.pb.h"
2224

25+
// clang-format off
2326
#include "opentelemetry/exporters/otlp/protobuf_include_suffix.h"
27+
// clang-format on
2428

2529
OPENTELEMETRY_BEGIN_NAMESPACE
2630
namespace exporter

0 commit comments

Comments
 (0)