%if 0%{with jaeger}
BuildRequires: bison
BuildRequires: flex
+BuildRequires: thrift-devel >= 0.13.0
%if 0%{?fedora} || 0%{?rhel}
BuildRequires: json-devel
%endif
%endif
Provides: libjaegertracing.so.0()(64bit)
Provides: libopentracing.so.1()(64bit)
-Provides: libthrift.so.0.13.0()(64bit)
%description -n libjaeger
This package contains libraries needed to provide distributed
tracing for Ceph.
%if %{with jaeger}
%files -n libjaeger
%{_libdir}/libopentracing.so.*
-%{_libdir}/libthrift.so.*
%{_libdir}/libjaegertracing.so.*
%post -n libjaeger -p /sbin/ldconfig
%postun -n libjaeger -p /sbin/ldconfig
# This module builds Jaeger after it's dependencies are installed and discovered
# opentracing: is built using cmake/modules/Buildopentracing.cmake
-# Thrift: build using cmake/modules/Buildthrift.cmake
+# Thrift: found using cmake/modules/Findthrift.cmake (not by default)
# yaml-cpp, nlhomann-json: are installed locally and then discovered using
# Find<package>.cmake
-# Boost Libraries used for building thrift are build and provided by
-# cmake/modules/BuildBoost.cmake
+# Boost Libraries: uses ceph build boost cmake/modules/BuildBoost.cmake
function(build_jaeger)
set(Jaeger_SOURCE_DIR "${CMAKE_SOURCE_DIR}/src/jaegertracing/jaeger-client-cpp")
+++ /dev/null
-function(build_thrift)
- set(thrift_SOURCE_DIR "${CMAKE_SOURCE_DIR}/src/jaegertracing/thrift")
- set(thrift_BINARY_DIR "${CMAKE_BINARY_DIR}/external/thrift")
-
- set(thrift_CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_POSITION_INDEPENDENT_CODE=ON
- -DBUILD_JAVA=OFF
- -DBUILD_PYTHON=OFF
- -DBUILD_TESTING=OFF
- -DBUILD_TUTORIALS=OFF
- -DBUILD_C_GLIB=OFF
- -DBUILD_HASKELL=OFF
- -DWITH_LIBEVENT=OFF
- -DWITH_ZLIB=OFF
- -DBoost_INCLUDE_DIRS=${CMAKE_BINARY_DIR}/boost/include
- -DCMAKE_INSTALL_PREFIX="${CMAKE_BINARY_DIR}/boost;${CMAKE_BINARY_DIR}/boost/include;${CMAKE_BINARY_DIR}/external"
- -DCMAKE_FIND_ROOT_PATH="${CMAKE_BINARY_DIR}/boost;${CMAKE_BINARY_DIR}/boost/include;${CMAKE_BINARY_DIR}/external"
- -DCMAKE_INSTALL_RPATH=${CMAKE_BINARY_DIR}/external/lib
- -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE
- -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/external
- -DCMAKE_INSTALL_LIBDIR=${CMAKE_BINARY_DIR}/external/lib)
-
- if(WITH_SYSTEM_BOOST)
- message(STATUS "thrift will be using system boost")
- set(dependencies "")
- list(APPEND thrift_CMAKE_ARGS -DBOOST_ROOT=/opt/ceph)
- list(APPEND thrift_CMAKE_ARGS -DCMAKE_FIND_ROOT_PATH=/opt/ceph)
- else()
- message(STATUS "thrift will be using external build boost")
- set(dependencies Boost)
- list(APPEND thrift_CMAKE_ARGS -DCMAKE_FIND_ROOT_PATH=${CMAKE_BINARY_DIR}/boost)
- list(APPEND thrift_CMAKE_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_BINARY_DIR}/external)
- endif()
-
- if(CMAKE_MAKE_PROGRAM MATCHES "make")
- # try to inherit command line arguments passed by parent "make" job
- set(make_cmd $(MAKE) thrift)
- else()
- set(make_cmd ${CMAKE_COMMAND} --build <BINARY_DIR> --target thrift)
- endif()
- set(install_cmd ${CMAKE_MAKE_PROGRAM} install)
-
- include(ExternalProject)
- ExternalProject_Add(thrift
- SOURCE_DIR ${thrift_SOURCE_DIR}
- PREFIX "${CMAKE_BINARY_DIR}/external/thrift"
- CMAKE_ARGS ${thrift_CMAKE_ARGS}
- BINARY_DIR ${thrift_BINARY_DIR}
- BUILD_COMMAND ${make_cmd}
- INSTALL_COMMAND ${install_cmd}
- DEPENDS ${dependencies}
- BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/external/lib/libthrift.so
- )
-endfunction()
add_dependencies(common-objs legacy-option-headers)
if(WITH_JAEGER)
- include(BuildJaeger)
+ find_package(thrift 0.13.0)
find_package(yaml-cpp 0.6.0 REQUIRED)
+ include(BuildJaeger)
list(APPEND jaeger_base
opentracing::libopentracing
- thrift::libthrift
jaegertracing::libjaegertracing)
target_link_libraries(jaeger-base INTERFACE
yaml-cpp::yaml-cpp