Commit 9fe0333
committed
fix(testing_util): link opentelemetry-cpp SDK as PUBLIC
The `opentelemetry_matchers.h` public header of `google_cloud_cpp_testing`
includes and uses opentelemetry-cpp SDK symbols inline (e.g.
`sdk::trace::SpanData::GetAttributes()`). Tests that link
`google_cloud_cpp_testing` therefore reference these SDK symbols directly
from their own translation units.
However, the CMake build links `opentelemetry-cpp::in_memory_span_exporter`
and `opentelemetry-cpp::trace` as PRIVATE, so they are not propagated to
the test executables. When building with shared libraries this fails to
link, e.g.:
undefined reference to symbol
'...sdk::trace::SpanData::GetAttributes[abi:cxx11]() const'
libopentelemetry_trace.so: error adding symbols:
DSO missing from command line
The Bazel build already exposes these dependencies transitively (via
`google_cloud_cpp_testing_private`), so making the CMake link PUBLIC also
aligns the two build systems.1 parent cf931ff commit 9fe0333
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
| 61 | + | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
0 commit comments