Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opentelemetry-cpp: add version 1.8.2, update dependencies #15687

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions recipes/opentelemetry-cpp/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"1.8.2":
url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.8.2.tar.gz"
sha256: "20fa97e507d067e9e2ab0c1accfc334f5a4b10d01312e55455dc3733748585f4"
"1.8.1":
url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.8.1.tar.gz"
sha256: "3d640201594b07f08dade9cd1017bd0b59674daca26223b560b9bb6bf56264c2"
Expand All @@ -25,6 +28,10 @@ sources:
sha256: "32f12ff15ec257e3462883f84bc291c2d5dc30055604c12ec4b46a36dfa3f189"

patches:
"1.8.2":
- patch_file: "patches/1.8.2-0001-fix-cmake.patch"
patch_description: "fix lack of linking libraries due to conan not generating the variables that are expected"
patch_type: "conan"
"1.8.1":
- patch_file: "patches/1.8.1-0001-fix-cmake.patch"
patch_description: "fix lack of linking libraries due to conan not generating the variables that are expected"
Expand Down
6 changes: 4 additions & 2 deletions recipes/opentelemetry-cpp/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def layout(self):
def requirements(self):
self.requires("abseil/20220623.0")
self.requires("grpc/1.50.1")
self.requires("libcurl/7.86.0")
self.requires("libcurl/7.87.0")
self.requires("nlohmann_json/3.11.2")
self.requires("openssl/1.1.1s")
if Version(self.version) <= "1.4.1":
Expand All @@ -63,7 +63,7 @@ def requirements(self):
self.requires("protobuf/3.21.4")
self.requires("thrift/0.17.0")
if Version(self.version) >= "1.3.0":
self.requires("boost/1.80.0")
self.requires("boost/1.81.0")

def validate(self):
if self.info.settings.compiler.cppstd:
Expand Down Expand Up @@ -103,6 +103,8 @@ def generate(self):
tc.variables["WITH_EXAMPLES"] = False
tc.variables["WITH_JAEGER"] = True
tc.variables["WITH_OTLP"] = True
if Version(self.version) >= "1.8.2":
tc.variables["WITH_OTLP_HTTP"] = True
tc.variables["WITH_ZIPKIN"] = True
tc.generate()

Expand Down
27 changes: 27 additions & 0 deletions recipes/opentelemetry-cpp/all/patches/1.8.2-0001-fix-cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9df8f5c..43b9d82 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -251,7 +251,6 @@ if(WITH_JAEGER)
find_package(Thrift QUIET)
if(Thrift_FOUND)
find_package(Boost REQUIRED)
- include_directories(${Boost_INCLUDE_DIR})
else()
# Install Thrift and propagate via vcpkg toolchain file
if(WIN32 AND (NOT DEFINED CMAKE_TOOLCHAIN_FILE))
diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake
index a21c0f1..a467ffd 100644
--- a/cmake/opentelemetry-proto.cmake
+++ b/cmake/opentelemetry-proto.cmake
@@ -280,6 +280,10 @@ else() # cmake 3.8 or lower
target_link_libraries(opentelemetry_proto INTERFACE ${Protobuf_LIBRARIES})
endif()

+if(TARGET gRPC::grpc++)
+ target_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++)
+endif()
+
if(BUILD_SHARED_LIBS)
set_property(TARGET opentelemetry_proto PROPERTY POSITION_INDEPENDENT_CODE ON)
endif()
9 changes: 3 additions & 6 deletions recipes/opentelemetry-cpp/all/test_v1_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
cmake_minimum_required(VERSION 3.8)

project(test_package CXX)
project(test_package)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

find_package(opentelemetry-cpp REQUIRED CONFIG)

add_executable(${PROJECT_NAME} ../test_package/test_package.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE opentelemetry-cpp::opentelemetry-cpp)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/
${CMAKE_CURRENT_BINARY_DIR}/test_package/)
2 changes: 2 additions & 0 deletions recipes/opentelemetry-cpp/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"1.8.2":
folder: all
"1.8.1":
folder: all
"1.7.0":
Expand Down