From: Deepika Upadhyay Date: Mon, 4 Oct 2021 08:10:48 +0000 (+0530) Subject: cmake,rgw: use jaeger-base target, as a dependency for building dbstore X-Git-Tag: v17.1.0~765^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=463193bcaf8b3b8a0e616315c8b650acdfe7b53a;p=ceph-ci.git 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 --- diff --git a/cmake/modules/BuildJaeger.cmake b/cmake/modules/BuildJaeger.cmake index ffd301b7b08..6a65a6bb42b 100644 --- a/cmake/modules/BuildJaeger.cmake +++ b/cmake/modules/BuildJaeger.cmake @@ -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) diff --git a/cmake/modules/BuildOpenTracing.cmake b/cmake/modules/BuildOpenTracing.cmake index 5098709dbdb..07a1ea44d1c 100644 --- a/cmake/modules/BuildOpenTracing.cmake +++ b/cmake/modules/BuildOpenTracing.cmake @@ -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() diff --git a/src/rgw/CMakeLists.txt b/src/rgw/CMakeLists.txt index 58363d8d6f4..5acbd17a2dd 100644 --- a/src/rgw/CMakeLists.txt +++ b/src/rgw/CMakeLists.txt @@ -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) diff --git a/src/rgw/store/dbstore/CMakeLists.txt b/src/rgw/store/dbstore/CMakeLists.txt index 12b641673c7..39a233d90d8 100644 --- a/src/rgw/store/dbstore/CMakeLists.txt +++ b/src/rgw/store/dbstore/CMakeLists.txt @@ -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)