Skip to content

Commit 664955d

Browse files
authored
opentelemetry-cpp: add version 1.22.0 (#28386)
1 parent 901e3b7 commit 664955d

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
sources:
2+
"1.22.0":
3+
url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.22.0.tar.gz"
4+
sha256: "3428f433f4b435ed1fad64cbdbe75b7288c06f6297786a7036d65d5b9a1d215b"
25
"1.21.0":
36
url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.21.0.tar.gz"
47
sha256: "98e5546f577a11b52a57faed1f4cc60d8c1daa44760eba393f43eab5a8ec46a2"

recipes/opentelemetry-cpp/all/conanfile.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from conan.tools.files import get, copy, rmdir, replace_in_file
55
from conan.tools.build import check_min_cppstd
66
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
7+
from conan.tools.scm import Version
78

89
import os
910

@@ -179,12 +180,21 @@ def _patch_sources(self):
179180
if self._needs_proto:
180181
protos_path = self.dependencies.build["opentelemetry-proto"].conf_info.get("user.opentelemetry-proto:proto_root").replace("\\", "/")
181182
protos_cmake_path = os.path.join(self.source_folder, "cmake", "opentelemetry-proto.cmake")
182-
replace_in_file(self, protos_cmake_path,
183-
"if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/opentelemetry-proto/.git)",
184-
"if(1)")
185-
replace_in_file(self, protos_cmake_path,
186-
'"${CMAKE_CURRENT_SOURCE_DIR}/third_party/opentelemetry-proto")',
187-
f'"{protos_path}")')
183+
184+
if Version(self.version) < "1.22.0":
185+
replace_in_file(self, protos_cmake_path,
186+
"if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/opentelemetry-proto/.git)",
187+
"if(1)")
188+
replace_in_file(self, protos_cmake_path,
189+
'"${CMAKE_CURRENT_SOURCE_DIR}/third_party/opentelemetry-proto")',
190+
f'"{protos_path}")')
191+
else:
192+
replace_in_file(self, protos_cmake_path,
193+
"elseif(EXISTS ${OPENTELEMETRY_PROTO_SUBMODULE}/.git)",
194+
"elseif(1)")
195+
replace_in_file(self, protos_cmake_path,
196+
'SOURCE_DIR ${OPENTELEMETRY_PROTO_SUBMODULE}',
197+
f'SOURCE_DIR ${protos_path}')
188198

189199
rmdir(self, os.path.join(self.source_folder, "api", "include", "opentelemetry", "nostd", "absl"))
190200

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
versions:
2+
"1.22.0":
3+
folder: all
24
"1.21.0":
35
folder: all

0 commit comments

Comments
 (0)