Skip to content

Commit c9cb2df

Browse files
committed
Fix linking error
1 parent 37e5081 commit c9cb2df

File tree

4 files changed

+10
-14
lines changed

4 files changed

+10
-14
lines changed

cmake/opentelemetry-proto.cmake

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -328,12 +328,10 @@ add_library(
328328
set_target_version(opentelemetry_proto)
329329

330330
# Disable include-what-you-use on generated code.
331-
set_target_properties(
332-
opentelemetry_proto
333-
PROPERTIES CXX_INCLUDE_WHAT_YOU_USE ""
334-
)
331+
set_target_properties(opentelemetry_proto PROPERTIES CXX_INCLUDE_WHAT_YOU_USE
332+
"")
335333

336-
if(WITH_ABSEIL)
334+
if(WITH_ABSEIL OR WITH_OTLP_GRPC)
337335
target_link_libraries(opentelemetry_proto PUBLIC absl::bad_variant_access)
338336
endif()
339337

@@ -393,12 +391,10 @@ else() # cmake 3.8 or lower
393391
endif()
394392

395393
if(WITH_OTLP_GRPC)
396-
if(WITH_ABSEIL)
397-
find_package(absl CONFIG)
398-
if(TARGET absl::synchronization)
399-
target_link_libraries(opentelemetry_proto_grpc
400-
PRIVATE absl::synchronization)
401-
endif()
394+
find_package(absl CONFIG)
395+
if(TARGET absl::synchronization)
396+
target_link_libraries(opentelemetry_proto_grpc
397+
PRIVATE absl::synchronization)
402398
endif()
403399
endif()
404400

cmake/patch-imported-config.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if(TARGET CURL::libcurl
2929
endif()
3030

3131
# abseil targets
32-
if(WITH_ABSEIL)
32+
if(WITH_ABSEIL OR WITH_OTLP_GRPC)
3333
project_build_tools_patch_default_imported_config(
3434
absl::bad_variant_access
3535
absl::raw_logging_internal

examples/grpc/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ else()
3939
target_link_libraries(example_grpc_proto PUBLIC gRPC::grpc++
4040
${Protobuf_LIBRARIES})
4141
endif()
42-
if(WITH_ABSEIL)
42+
if(WITH_ABSEIL OR WITH_OTLP_GRPC)
4343
target_link_libraries(example_grpc_proto PUBLIC absl::bad_variant_access)
4444
endif()
4545

sdk/src/common/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ target_link_libraries(
1717
opentelemetry_common PUBLIC opentelemetry_api opentelemetry_sdk
1818
Threads::Threads)
1919

20-
if(WITH_ABSEIL)
20+
if(WITH_ABSEIL OR WITH_OTLP_GRPC)
2121
target_link_libraries(opentelemetry_common PUBLIC absl::strings)
2222
endif()
2323

0 commit comments

Comments
 (0)