From a7b3a0df6e69b0fc52e5d0d69394b8759c9e4bd8 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Tue, 22 Sep 2026 21:30:22 +0100 Subject: [PATCH] fix(tests): Locate the in-memory exporter by build config The find_library hint was pinned to the _RELEASE variable CMakeDeps generates, so in any other configuration it expanded to nothing. The archive was then found only via CMAKE_PREFIX_PATH, which can hand a Debug build the Release archive instead of failing. Derive the suffix from CMAKE_BUILD_TYPE and ask for the package's lib directory directly. Co-Authored-By: Claude Opus 5 (1M context) --- src/tests/libxrpl/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/tests/libxrpl/CMakeLists.txt b/src/tests/libxrpl/CMakeLists.txt index b4a1c2055b..5ca0c7ef87 100644 --- a/src/tests/libxrpl/CMakeLists.txt +++ b/src/tests/libxrpl/CMakeLists.txt @@ -99,10 +99,17 @@ if(telemetry) # libs, so neither the umbrella target nor opentelemetry-cpp::exporter_in_memory # puts the archive on the link line. Locate it by path and link it BEFORE # the umbrella so its undefined SDK references resolve against the umbrella. + # CMakeDeps suffixes its variables with the upper-cased build type, so a + # hardcoded _RELEASE hint is empty in any other config and the archive is + # then only found by luck. Derive the suffix instead. An empty hint is not + # fatal on its own: the Conan toolchain puts the package on + # CMAKE_PREFIX_PATH, which find_library searches anyway. REQUIRED turns a + # miss into a configure error rather than a link error. + string(TOUPPER "${CMAKE_BUILD_TYPE}" otel_build_type) find_library( OTEL_IN_MEMORY_EXPORTER_LIB NAMES opentelemetry_exporter_in_memory - HINTS "${opentelemetry-cpp_PACKAGE_FOLDER_RELEASE}/lib" + HINTS "${opentelemetry-cpp_LIB_DIRS_${otel_build_type}}" REQUIRED ) target_link_libraries(