Skip to content

Commit

Permalink
(#21933) plf_list: add v2.70
Browse files Browse the repository at this point in the history
* plf_list: add v2.70

* plf_list: C++17 is required for latest version
  • Loading branch information
valgur authored Jan 8, 2024
1 parent 1e5b0a4 commit f174071
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 2 deletions.
3 changes: 3 additions & 0 deletions recipes/plf_list/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"2.70":
url: "https://github.com/mattreecebentley/plf_list/archive/c48d271caad535a783a37e418e1f146040934a30.tar.gz"
sha256: "d6bd1dfb4e7e02804ad91c5a06c9d6f3a3512499ce5c3c0a633eba5e67e90930"
"2.57":
url: "https://github.com/mattreecebentley/plf_list/archive/d7a06d7497dc01261dd2c2fe675a8b605acb7a56.tar.gz"
sha256: "4297c7578fe5ea2c6346541b28a57d87ec311522fa55bc8a5ab069921fc073e9"
Expand Down
31 changes: 29 additions & 2 deletions recipes/plf_list/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd
from conan.tools.files import copy, get, apply_conandata_patches, export_conandata_patches
from conan.tools.layout import basic_layout
from conan.tools.scm import Version
import os


required_conan_version = ">=1.50.0"


Expand All @@ -15,6 +19,20 @@ class PlflistConan(ConanFile):
homepage = "https://github.com/mattreecebentley/plf_list"
settings = "os", "arch", "compiler", "build_type"

@property
def _min_cppstd(self):
return 17

@property
def _minimum_compilers_version(self):
return {
"gcc": "7",
"clang": "5",
"apple-clang": "9",
"msvc": "191",
"Visual Studio": "15",
}

def export_sources(self):
export_conandata_patches(self)

Expand All @@ -24,9 +42,18 @@ def package_id(self):
def layout(self):
basic_layout(self, src_folder="src")

def validate(self):
if Version(self.version) >= "2.70":
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, self._min_cppstd)
minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False)
if minimum_version and Version(self.settings.compiler.version) < minimum_version:
raise ConanInvalidConfiguration(
f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.",
)

def source(self):
get(self, **self.conan_data["sources"][self.version],
destination=self.source_folder, strip_root=True)
get(self, **self.conan_data["sources"][self.version], strip_root=True)

def build(self):
apply_conandata_patches(self)
Expand Down
3 changes: 3 additions & 0 deletions recipes/plf_list/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ find_package(plf_list REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE plf_list::plf_list)
if (plf_list_VERSION VERSION_GREATER_EQUAL 2.70)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
endif()
2 changes: 2 additions & 0 deletions recipes/plf_list/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"2.70":
folder: all
"2.57":
folder: all
"2.52":
Expand Down

0 comments on commit f174071

Please sign in to comment.