xproperty: add version 0.12.0 (#24219)

Co-authored-by: PerseoGI <perseog@jfrog.com>
This commit is contained in:
toge
2024-11-13 01:27:13 +09:00
committed by GitHub
parent 5886927409
commit b185f7ea17
4 changed files with 23 additions and 7 deletions

View File

@@ -1,4 +1,7 @@
sources:
"0.12.0":
url: "https://github.com/jupyter-xeus/xproperty/archive/refs/tags/0.12.0.tar.gz"
sha256: "27cbc8e441dcc515a1ebbf11bad5ef240748d32f5e1adf84deed87a1dc57a440"
"0.11.0":
url: "https://github.com/jupyter-xeus/xproperty/archive/refs/tags/0.11.0.tar.gz"
sha256: "bf86a11c6758308aa0aa0f64d8dd24cd3e9d78378467b74002f552bfb75fc0eb"

View File

@@ -2,35 +2,42 @@ from conan import ConanFile
from conan.tools.build import check_min_cppstd
from conan.tools.files import copy, get, save
from conan.tools.layout import basic_layout
from conan.tools.scm import Version
import os
import textwrap
required_conan_version = ">=1.52.0"
required_conan_version = ">=2.1.0"
class XpropertyConan(ConanFile):
name = "xproperty"
description = "Traitlets-like C++ properties and implementation of the observer pattern."
license = "BSD-3-Clause"
topics = ("observer", "traitlets")
homepage = "https://github.com/jupyter-xeus/xproperty"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/jupyter-xeus/xproperty"
topics = ("observer", "traitlets", "header-only")
package_type = "header-library"
settings = "os", "arch", "compiler", "build_type"
no_copy_source = True
@property
def _min_cppstd(self):
return "14" if Version(self.version) <= "0.12.0" else "17"
def layout(self):
basic_layout(self, src_folder="src")
def requirements(self):
self.requires("xtl/0.7.4", transitive_headers=True, transitive_libs=True)
if Version(self.version) < "0.12.0":
self.requires("xtl/0.7.4", transitive_headers=True, transitive_libs=True)
else:
self.requires("nlohmann_json/3.11.3")
def package_id(self):
self.info.clear()
def validate(self):
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, 14)
check_min_cppstd(self, self._min_cppstd)
def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)

View File

@@ -5,4 +5,8 @@ find_package(xproperty REQUIRED CONFIG)
add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE xproperty)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)
if(xproperty_VERSION VERSION_LESS "0.12.0")
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)
else()
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
endif()

View File

@@ -1,3 +1,5 @@
versions:
"0.12.0":
folder: all
"0.11.0":
folder: all