Skip to content

Commit

Permalink
[BUILD] Do not link prometheus-cpp::util when it doesn't exist (#2606)
Browse files Browse the repository at this point in the history
  • Loading branch information
owent committed Mar 25, 2024
1 parent 9500c12 commit 02e6ad2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions exporters/prometheus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ endif()
if(TARGET util)
list(APPEND PROMETHEUS_EXPORTER_TARGETS util)
endif()
target_link_libraries(
opentelemetry_exporter_prometheus
PUBLIC opentelemetry_metrics prometheus-cpp::pull prometheus-cpp::core
prometheus-cpp::util)
set(PROMETHEUS_CPP_TARGETS prometheus-cpp::pull prometheus-cpp::core)
if(TARGET prometheus-cpp::util)
list(APPEND PROMETHEUS_CPP_TARGETS prometheus-cpp::util)
endif()
target_link_libraries(opentelemetry_exporter_prometheus
PUBLIC opentelemetry_metrics ${PROMETHEUS_CPP_TARGETS})

if(OPENTELEMETRY_INSTALL)
install(
Expand Down

0 comments on commit 02e6ad2

Please sign in to comment.