cmake,rgw: use jaeger-base target, as a dependency for building dbstore

* dbstore also has tracing dependencies and missing linking for libraries
* use `using` keyword in common/tracer.cc to silence unused method
  warnings
* log building of external project jaegertracing, opentracing into build
  file, (done to reduce external project build verbosity)

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
This commit is contained in:
Deepika Upadhyay 2021-10-04 13:40:48 +05:30
parent b70647e879
commit 463193bcaf
4 changed files with 11 additions and 3 deletions

View File

@ -79,7 +79,7 @@ function(build_jaeger)
INSTALL_COMMAND ${install_cmd}
DEPENDS ${dependencies}
BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/external/lib/libjaegertracing.so
)
LOG_BUILD ON)
set_library_properties_for_external_project(opentracing::libopentracing
opentracing)

View File

@ -32,5 +32,5 @@ function(build_opentracing)
BUILD_COMMAND ${make_cmd}
INSTALL_COMMAND ${install_cmd}
BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/external/lib/libopentracing.so
)
LOG_BUILD ON)
endfunction()

View File

@ -169,6 +169,9 @@ if(WITH_RADOSGW_DBSTORE)
add_subdirectory(store/dbstore)
list(APPEND librgw_common_srcs rgw_sal_dbstore.cc)
endif()
if(WITH_JAEGER)
list(APPEND librgw_common_srcs rgw_tracer.cc)
endif()
add_library(rgw_common STATIC ${librgw_common_srcs})
@ -240,6 +243,7 @@ endif()
if(WITH_JAEGER)
add_dependencies(rgw_common jaeger-base)
target_link_libraries(rgw_common PUBLIC jaeger-base)
endif()
if(WITH_RADOSGW_DBSTORE)

View File

@ -19,7 +19,11 @@ set(dbstore_mgr_srcs
add_library(dbstore_lib ${dbstore_srcs})
target_include_directories(dbstore_lib PUBLIC "${CMAKE_SOURCE_DIR}/src/fmt/include")
target_include_directories(dbstore_lib PUBLIC "${CMAKE_SOURCE_DIR}/src/rgw")
target_link_libraries(dbstore_lib PUBLIC spawn)
set(link_targets spawn)
if(WITH_JAEGER)
list(APPEND link_targets jaeger-base)
endif()
target_link_libraries(dbstore_lib PUBLIC ${link_targets})
set (CMAKE_LINK_LIBRARIES ${CMAKE_LINK_LIBRARIES} dbstore_lib)