]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake, ceph.spec, debian: use yaml-cpp >= 0.6
authorDeepika Upadhyay <dupadhya@redhat.com>
Wed, 21 Jul 2021 16:29:21 +0000 (21:59 +0530)
committerDeepika Upadhyay <dupadhya@redhat.com>
Thu, 22 Jul 2021 05:28:08 +0000 (10:58 +0530)
* since focal and centos both have yaml-cpp 0.6 available, which dropped
having boost as it's dependency, moving to 0.6 seems a good upgrade.

* cmake: delete Buildyaml, since distro suppilies v0.6 this is not needed

This fixes the build failure, as jaegertracing requires yaml-cpp v0.6+
```
Could NOT find yaml-cpp: Found unsuitable version "", but required is at
  least "0.5.1" (found yaml-cpp_LIBRARY-NOTFOUND)

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
ceph.spec.in
cmake/modules/BuildJaeger.cmake
cmake/modules/Buildyaml-cpp.cmake [deleted file]
src/CMakeLists.txt

index 3f5cd53aac264e4bed0e652575f8532161660662..7f936b90c154dd3556dabb4edacfc47a3058eccb 100644 (file)
@@ -238,6 +238,9 @@ BuildRequires:      xfsprogs-devel
 BuildRequires: xmlstarlet
 BuildRequires: nasm
 BuildRequires: lua-devel
+%if 0%{with seastar} || 0%{with jaeger}
+BuildRequires:  yaml-cpp-devel >= 0.6
+%endif
 %if 0%{with amqp_endpoint}
 BuildRequires:  librabbitmq-devel
 %endif
@@ -273,7 +276,6 @@ BuildRequires:  json-devel
 BuildRequires:  nlohmann_json-devel
 %endif
 BuildRequires:  libevent-devel
-BuildRequires:  yaml-cpp-devel
 %endif
 %if 0%{with system_pmdk}
 BuildRequires:  libpmem-devel
@@ -288,7 +290,6 @@ BuildRequires:  lksctp-tools-devel
 BuildRequires:  protobuf-devel
 BuildRequires:  ragel
 BuildRequires:  systemtap-sdt-devel
-BuildRequires:  yaml-cpp-devel
 %if 0%{?fedora}
 BuildRequires:  libubsan
 BuildRequires:  libasan
index 55f9b31aeec0864a48737dcbb59637c54c499191..76b9e6989e2b7501b950c455f6dc8ba1b8a07cde 100644 (file)
@@ -34,14 +34,6 @@ function(build_jaeger)
   build_opentracing()
   include(Buildthrift)
   build_thrift()
-  if(NOT yaml-cpp_FOUND)
-    include(Buildyaml-cpp)
-    build_yamlcpp()
-    add_library(yaml-cpp::yaml-cpp SHARED IMPORTED)
-    add_dependencies(yaml-cpp::yaml-cpp yaml-cpp)
-    set_library_properties_for_external_project(yaml-cpp::yaml-cpp yaml-cpp)
-    list(APPEND dependencies "yaml-cpp")
-  endif()
 
   if(CMAKE_MAKE_PROGRAM MATCHES "make")
     # try to inherit command line arguments passed by parent "make" job
diff --git a/cmake/modules/Buildyaml-cpp.cmake b/cmake/modules/Buildyaml-cpp.cmake
deleted file mode 100644 (file)
index 4f2d136..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-function(build_yamlcpp)
-  set(yaml-cpp_DOWNLOAD_DIR "${CMAKE_SOURCE_DIR}/src/jaegertracing")
-  set(yaml-cpp_SOURCE_DIR "${CMAKE_SOURCE_DIR}/src/jaegertracing/yaml-cpp")
-  set(yaml-cpp_BINARY_DIR "${CMAKE_BINARY_DIR}/external/yaml-cpp")
-
-  set(yaml-cpp_CMAKE_ARGS -DBUILD_SHARED_LIBS=ON
-                         -DYAML_CPP_BUILD_TESTS=OFF
-                         -DYAML_CPP_BUILD_CONTRIB=OFF
-                         -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/external
-                         -DCMAKE_INSTALL_RPATH=${CMAKE_BINARY_DIR}/external/lib
-                         -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE
-                         -DCMAKE_INSTALL_LIBDIR=${CMAKE_BINARY_DIR}/external/lib
-                         -DCMAKE_PREFIX_PATH=${CMAKE_BINARY_DIR}/external)
-
-  if(CMAKE_MAKE_PROGRAM MATCHES "make")
-    # try to inherit command line arguments passed by parent "make" job
-    set(make_cmd $(MAKE) yaml-cpp)
-  else()
-    set(make_cmd ${CMAKE_COMMAND} --build <BINARY_DIR> --target yaml-cpp)
-  endif()
-  set(install_cmd ${CMAKE_MAKE_PROGRAM} install)
-
-  include(ExternalProject)
-  ExternalProject_Add(yaml-cpp
-    GIT_REPOSITORY "https://github.com/jbeder/yaml-cpp.git"
-    GIT_TAG "yaml-cpp-0.6.2"
-    UPDATE_COMMAND ""
-    INSTALL_DIR "${CMAKE_BINARY_DIR}/external"
-    DOWNLOAD_DIR ${yaml-cpp_DOWNLOAD_DIR}
-    SOURCE_DIR ${yaml-cpp_SOURCE_DIR}
-    PREFIX "${CMAKE_BINARY_DIR}/external/yaml-cpp"
-    CMAKE_ARGS ${yaml-cpp_CMAKE_ARGS}
-    BUILD_COMMAND ${make_cmd}
-    INSTALL_COMMAND ${install_cmd}
-    )
-endfunction()
index 760a2ceb0ca0d23802e25e80b2ccaa16dd4e9ba4..22cc4e1b8b5199bc4937245dba5509d738aa834f 100644 (file)
@@ -425,21 +425,9 @@ add_library(common-objs OBJECT ${libcommon_files})
 add_dependencies(common-objs legacy-option-headers)
 
 if(WITH_JAEGER)
-  find_package(yaml-cpp 0.6.0)
-  if(NOT yaml-cpp_FOUND)
-    set(jaeger_libs ${CMAKE_BINARY_DIR}/external/lib/libyaml-cpp.so
-                   ${CMAKE_BINARY_DIR}/external/lib/libyaml-cpp.so.0.6
-                   ${CMAKE_BINARY_DIR}/external/lib/libyaml-cpp.so.0.6.2)
-    #customize libjaeger.install
-    execute_process(COMMAND bash -c "sed -i 's/#//' debian/libjaeger.install"
-                   WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
-    execute_process(COMMAND bash -c "grep -q 'yaml-cpp' debian/libjaeger.install || echo 'usr/lib/libyaml-cpp.so.*' >> debian/libjaeger.install"
-                   WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
-  endif()
-  include(IncludeJaeger)
-  add_library(jaeger-base INTERFACE)
-  add_dependencies(common-objs
-  yaml-cpp::yaml-cpp
+  include(BuildJaeger)
+  find_package(yaml-cpp 0.6.0 REQUIRED)
+  list(APPEND jaeger_base
   opentracing::libopentracing
   thrift::libthrift
   jaegertracing::libjaegertracing)