fix(build): Export XRPL_ENABLE_TELEMETRY to consumers of libxrpl

CMake sets the define with add_compile_definitions, which is scoped to this
build, so it reached no consumer. Four public telemetry headers change class
layout on it: with the define SpanGuard holds a unique_ptr and its methods are
out of line in the library, without it SpanGuard is empty and all-inline.

A package compiling against the installed headers therefore built a different
SpanGuard than the one it linked. Exporting the define through cpp_info keeps
the two in step, and it stays inside the existing telemetry option so the Conan
option remains the only switch.
This commit is contained in:
Pratik Mankawde
2026-09-22 20:29:41 +01:00
parent 5e266e0e04
commit 09a017d01e

View File

@@ -239,3 +239,7 @@ class Xrpl(ConanFile):
libxrpl.requires.append("rocksdb::librocksdb")
if self.options.telemetry:
libxrpl.requires.append("opentelemetry-cpp::opentelemetry-cpp")
# The public telemetry headers pick their class layout on this
# define, so a consumer that does not see it compiles a different
# SpanGuard than the one inside the library it links.
libxrpl.defines.append("XRPL_ENABLE_TELEMETRY")