Skip to content

Commit 06fb0be

Browse files
authored
fast-cdr: dont publish new revisions for older versions (#28118)
* fast-cdr: dont publish new revisions for older versions * remove patches folder
1 parent 7630364 commit 06fb0be

File tree

4 files changed

+7
-111
lines changed

4 files changed

+7
-111
lines changed

recipes/fast-cdr/all/conandata.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,6 @@ sources:
22
"2.2.5":
33
url: "https://github.com/eProsima/Fast-CDR/archive/v2.2.5.tar.gz"
44
sha256: "b01fd34135e9be5183bb69f31fa5b74c53ba6eca30a5b21de0120d21ece22a51"
5-
"2.2.3":
6-
url: "https://github.com/eProsima/Fast-CDR/archive/v2.2.3.tar.gz"
7-
sha256: "2501ef0930727d3b3ac1819672a6df8631a58fbcf7f005947046c2de46e8da69"
8-
"2.2.0":
9-
url: "https://github.com/eProsima/Fast-CDR/archive/v2.2.0.tar.gz"
10-
sha256: "8a75ee3aed59f495e95208050920d2c2146df92f073809505a3bd29011c21f20"
115
"2.1.0":
126
url: "https://github.com/eProsima/Fast-CDR/archive/v2.1.0.tar.gz"
137
sha256: "7ee3b3e977381f76f8d9ab1e1df7b5202556505b104afb3f03ee79bbe6507aa0"
14-
"2.0.0":
15-
url: "https://github.com/eProsima/Fast-CDR/archive/v2.0.0.tar.gz"
16-
sha256: "66234a5504879f7af706530996177df930d61dd88045dcafb73799458413ee93"
17-
"1.1.0":
18-
url: "https://github.com/eProsima/Fast-CDR/archive/v1.1.0.tar.gz"
19-
sha256: "5c4b2ad5493abd30b9475b14856641a8944c98077a36bd0760c1d83c65216e67"
20-
"1.0.27":
21-
url: "https://github.com/eProsima/Fast-CDR/archive/v1.0.27.tar.gz"
22-
sha256: "a9bc8fd31a2c2b95e6d2fb46e6ce1ad733e86dc4442f733479e33ed9cdc54bf6"
23-
patches:
24-
"2.0.0":
25-
- patch_file: "patches/2.0.0-0001-Fix-for-non-CWG-1270-revision-compliant-compilers-17.patch"
26-
patch_type: "portability"
27-
patch_description: "Fix for non CWG 1270 revision compliant compilers"
28-
patch_source: "https://github.com/eProsima/Fast-CDR/pull/173"

recipes/fast-cdr/all/conanfile.py

Lines changed: 7 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
from conan.errors import ConanInvalidConfiguration
33
from conan.tools.build import check_min_cppstd
44
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
5-
from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rm, rmdir, save
5+
from conan.tools.files import collect_libs, copy, get, rm, rmdir
66
from conan.tools.microsoft import is_msvc, is_msvc_static_runtime
7-
from conan.tools.scm import Version
87
import os
9-
import textwrap
108

11-
required_conan_version = ">=1.54.0"
9+
required_conan_version = ">=2.2"
1210

1311

1412
class FastCDRConan(ConanFile):
@@ -30,33 +28,23 @@ class FastCDRConan(ConanFile):
3028
"fPIC": True,
3129
}
3230

33-
def export_sources(self):
34-
export_conandata_patches(self)
35-
36-
def config_options(self):
37-
if self.settings.os == "Windows":
38-
del self.options.fPIC
39-
40-
def configure(self):
41-
if self.options.shared:
42-
self.options.rm_safe("fPIC")
31+
implements = ["auto_shared_fpic"]
4332

4433
def layout(self):
4534
cmake_layout(self, src_folder="src")
4635

4736
def build_requirements(self):
48-
if Version(self.version) >= "1.1.0":
49-
self.tool_requires("cmake/[>=3.16.3 <4]")
37+
self.tool_requires("cmake/[>=3.16.3]")
5038

5139
def validate(self):
52-
if self.settings.compiler.get_safe("cppstd"):
53-
check_min_cppstd(self, 11)
40+
check_min_cppstd(self, 11)
41+
5442
if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self):
5543
# This combination leads to an fast-cdr error when linking
5644
# linking dynamic '*.dll' and static MT runtime
5745
# see https://github.com/eProsima/Fast-CDR/blob/v1.0.21/include/fastcdr/eProsima_auto_link.h#L37
5846
# (2021-05-31)
59-
raise ConanInvalidConfiguration("Mixing a dll eprosima library with a static runtime is a bad idea")
47+
raise ConanInvalidConfiguration("Windows msvc static runtime is not supported")
6048

6149
def source(self):
6250
get(self, **self.conan_data["sources"][self.version], strip_root=True)
@@ -67,7 +55,6 @@ def generate(self):
6755
tc.generate()
6856

6957
def build(self):
70-
apply_conandata_patches(self)
7158
cmake = CMake(self)
7259
cmake.configure()
7360
cmake.build()
@@ -81,27 +68,6 @@ def package(self):
8168
rm(self, "*.pdb", os.path.join(self.package_folder, "lib"))
8269
rm(self, "*.pdb", os.path.join(self.package_folder, "bin"))
8370

84-
# TODO: to remove in conan v2 once cmake_find_package_* generators removed
85-
self._create_cmake_module_alias_targets(
86-
os.path.join(self.package_folder, self._module_file_rel_path),
87-
{"fastcdr": "fastcdr::fastcdr"}
88-
)
89-
90-
def _create_cmake_module_alias_targets(self, module_file, targets):
91-
content = ""
92-
for alias, aliased in targets.items():
93-
content += textwrap.dedent(f"""\
94-
if(TARGET {aliased} AND NOT TARGET {alias})
95-
add_library({alias} INTERFACE IMPORTED)
96-
set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased})
97-
endif()
98-
""")
99-
save(self, module_file, content)
100-
101-
@property
102-
def _module_file_rel_path(self):
103-
return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake")
104-
10571
def package_info(self):
10672
self.cpp_info.set_property("cmake_file_name", "fastcdr")
10773
self.cpp_info.set_property("cmake_target_name", "fastcdr")
@@ -111,9 +77,3 @@ def package_info(self):
11177

11278
if self.settings.os in ["Linux"]:
11379
self.cpp_info.system_libs.append("m")
114-
115-
# TODO: to remove in conan v2 once cmake_find_package_* generators removed
116-
self.cpp_info.names["cmake_find_package"] = "fastcdr"
117-
self.cpp_info.names["cmake_find_package_multi"] = "fastcdr"
118-
self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path]
119-
self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path]

recipes/fast-cdr/all/patches/2.0.0-0001-Fix-for-non-CWG-1270-revision-compliant-compilers-17.patch

Lines changed: 0 additions & 33 deletions
This file was deleted.

recipes/fast-cdr/config.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
versions:
22
"2.2.5":
33
folder: all
4-
"2.2.3":
5-
folder: all
6-
"2.2.0":
7-
folder: all
84
"2.1.0":
95
folder: all
10-
"2.0.0":
11-
folder: all
12-
"1.1.0":
13-
folder: all
14-
"1.0.27":
15-
folder: all

0 commit comments

Comments
 (0)