]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: fix jaeger linking to ceph libraries 38783/head
authorDeepika Upadhyay <dupadhya@redhat.com>
Wed, 21 Jul 2021 16:11:37 +0000 (21:41 +0530)
committerDeepika Upadhyay <dupadhya@redhat.com>
Thu, 22 Jul 2021 05:39:09 +0000 (11:09 +0530)
updates:
* custom target jaeger_base
* target jaeger-base which encapsulates all jaeger libs
* include external libraries path needed linking libraries and including
  opentracing and jaegertracing headers files

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
src/CMakeLists.txt
src/os/CMakeLists.txt

index e0ecb15b1e61840732c52ad24040d9e1226a4573..12ef955b87f1d94ab763b977583ece88ca083a63 100644 (file)
@@ -434,15 +434,18 @@ if(WITH_JAEGER)
 
   build_jaeger()
 
+  include_directories(${CMAKE_BINARY_DIR}/external/include)
+  # for testing jaeger build
+  add_custom_target(jaeger_base DEPENDS ${jaeger_base})
+  add_library(jaeger-base INTERFACE)
+  add_dependencies(common-objs ${jaeger_base})
   target_link_libraries(jaeger-base INTERFACE
-  yaml-cpp::yaml-cpp
-  opentracing::libopentracing
-  thrift::libthrift
-  jaegertracing::libjaegertracing)
-  include_directories(SYSTEM ${CMAKE_BINARY_DIR}/external/include)
-  #with CMake 3.12+ the following can be replaced by:
-  #target_link_libraries(common-objs jaeger-base)
-   list(APPEND jaeger_libs
+    yaml-cpp::yaml-cpp
+    opentracing::libopentracing
+    thrift::libthrift
+    jaegertracing::libjaegertracing)
+
+  list(APPEND jaeger_libs
     ${CMAKE_BINARY_DIR}/external/lib/libjaegertracing.so.0
     ${CMAKE_BINARY_DIR}/external/lib/libjaegertracing.so.0.6.1
     ${CMAKE_BINARY_DIR}/external/lib/libopentracing.so.1.6.0)
index d31b4c70cc596f879f050220781a8ed1b6f064e0..377360f9af688596ab9a279d17201eea838b5641 100644 (file)
@@ -93,6 +93,7 @@ if(WITH_LTTNG)
 endif()
 
 if(WITH_JAEGER)
+  add_dependencies(os jaeger-base)
   target_link_libraries(os jaeger-base)
 endif()