Skip to content

Commit

Permalink
added public link of opentelemetry_proto_grpc against gRPC lib [onl…
Browse files Browse the repository at this point in the history
…y if gRPC library is shared] (#2268)
  • Loading branch information
ays7 authored Aug 21, 2023
1 parent d3799a6 commit 4bfddde
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmake/opentelemetry-proto.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,14 @@ if(WITH_OTLP_GRPC)
${LOGS_SERVICE_GRPC_PB_CPP_FILE} ${METRICS_SERVICE_GRPC_PB_CPP_FILE})

list(APPEND OPENTELEMETRY_PROTO_TARGETS opentelemetry_proto_grpc)
target_link_libraries(opentelemetry_proto_grpc PUBLIC opentelemetry_proto)
target_link_libraries(opentelemetry_proto_grpc
PUBLIC opentelemetry_proto)

get_target_property(grpc_lib_type gRPC::grpc++ TYPE)
if (grpc_lib_type STREQUAL "SHARED_LIBRARY")
target_link_libraries(opentelemetry_proto_grpc
PUBLIC gRPC::grpc++)
endif()
set_target_properties(opentelemetry_proto_grpc PROPERTIES EXPORT_NAME
proto_grpc)
patch_protobuf_targets(opentelemetry_proto_grpc)
Expand Down

0 comments on commit 4bfddde

Please sign in to comment.