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

Update to h5pp/1.11.0 #15077

Merged
merged 7 commits into from
Jan 27, 2023
Merged
Show file tree
Hide file tree
Changes from 6 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
3 changes: 3 additions & 0 deletions recipes/h5pp/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ sources:
"1.10.0":
sha256: 27a3e42ed02d8d9341229d58a517134753e1ea46dab4c40d01bb309098c32f13
url: https://github.com/DavidAce/h5pp/archive/v1.10.0.tar.gz
"1.11.0":
sha256: 1c4171275eb50a26ed9da8055397f03a726896c4c49ad0380b16dcb13574ecff
url: https://github.com/DavidAce/h5pp/archive/v1.11.0.tar.gz
37 changes: 22 additions & 15 deletions recipes/h5pp/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
from conan import ConanFile
from conan.tools.microsoft import is_msvc
from conans import ConanFile, tools
from conans.errors import ConanInvalidConfiguration
from conan.tools.scm import Version
from conan.tools.files import get
from conan.tools.build import check_min_cppstd
from conan.errors import ConanInvalidConfiguration
import os

required_conan_version = ">=1.45.0"
required_conan_version = ">=1.50.0"


class H5ppConan(ConanFile):
Expand Down Expand Up @@ -39,7 +42,7 @@ def _compilers_minimum_version(self):
}

def config_options(self):
if tools.Version(self.version) < "1.10.0":
if Version(self.version) < "1.10.0":
# These dependencies are always required before h5pp 1.10.0:
# * h5pp < 1.10.0 includes any version of headers indiscriminately (e.g. system headers),
# and can't tell if the the corresponding library will be linked. This makes the,
Expand All @@ -50,32 +53,36 @@ def config_options(self):
del self.options.with_spdlog

def requirements(self):
self.requires("hdf5/1.12.1")
if tools.Version(self.version) < "1.10.0" or self.options.get_safe('with_eigen'):
if Version(self.version) < "1.10.0":
self.requires("hdf5/1.12.1")
else:
self.requires("hdf5/1.13.1")

if Version(self.version) < "1.10.0" or self.options.get_safe('with_eigen'):
self.requires("eigen/3.4.0")
if tools.Version(self.version) < "1.10.0" or self.options.get_safe('with_spdlog'):
self.requires("spdlog/1.10.0")
if Version(self.version) < "1.10.0" or self.options.get_safe('with_spdlog'):
self.requires("spdlog/1.11.0")

def package_id(self):
self.info.header_only()
self.info.clear()

def validate(self):
if self.settings.compiler.get_safe("cppstd"):
tools.check_min_cppstd(self, 17)
check_min_cppstd(self, 17)
minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False)
if minimum_version:
if tools.Version(self.settings.compiler.version) < minimum_version:
if Version(self.settings.compiler.version) < minimum_version:
raise ConanInvalidConfiguration("h5pp requires C++17, which your compiler does not support.")
else:
self.output.warn("h5pp requires C++17. Your compiler is unknown. Assuming it supports C++17.")

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

def package(self):
self.copy("LICENSE", src=self._source_subfolder, dst="licenses")
if tools.Version(self.version) < "1.9.0":
if Version(self.version) < "1.9.0":
includedir = os.path.join(self._source_subfolder, "h5pp", "include")
else:
includedir = os.path.join(self._source_subfolder, "include")
Expand All @@ -89,7 +96,7 @@ def package_info(self):
self.cpp_info.components["h5pp_flags"].set_property("cmake_target_name", "h5pp::flags")
self.cpp_info.components["h5pp_deps"].requires = ["hdf5::hdf5"]

if tools.Version(self.version) >= "1.10.0":
if Version(self.version) >= "1.10.0":
if self.options.with_eigen:
self.cpp_info.components["h5pp_deps"].requires.append("eigen::eigen")
self.cpp_info.components["h5pp_flags"].defines.append("H5PP_USE_EIGEN3")
Expand All @@ -101,7 +108,7 @@ def package_info(self):
self.cpp_info.components["h5pp_deps"].requires.append("eigen::eigen")
self.cpp_info.components["h5pp_deps"].requires.append("spdlog::spdlog")

if (self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "9") or \
if (self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "9") or \
(self.settings.compiler == "clang" and self.settings.compiler.get_safe("libcxx") in ["libstdc++", "libstdc++11"]):
self.cpp_info.components["h5pp_flags"].system_libs = ["stdc++fs"]
if is_msvc(self):
Expand Down
2 changes: 2 additions & 0 deletions recipes/h5pp/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ versions:
folder: "all"
"1.10.0":
folder: "all"
"1.11.0":
folder: "all"