Skip to content

Commit

Permalink
kealib: require GCC 6+
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Nov 6, 2023
1 parent 88d9c85 commit eaaa5f2
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion recipes/kealib/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir
from conan.tools.scm import Version

required_conan_version = ">=1.53.0"

Expand All @@ -28,6 +29,16 @@ class KealibConan(ConanFile):
"fPIC": True,
}

@property
def _min_cppstd(self):
return 11

@property
def _compilers_minimum_version(self):
return {
"gcc": "6",
}

def export_sources(self):
export_conandata_patches(self)

Expand All @@ -49,7 +60,12 @@ def requirements(self):

def validate(self):
if self.settings.compiler.cppstd:
check_min_cppstd(self, 11)
check_min_cppstd(self, self._min_cppstd)
minimum_version = self._compilers_minimum_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."
)
hdf5_opts = self.dependencies["hdf5"].options
if not (hdf5_opts.enable_cxx and hdf5_opts.hl):
raise ConanInvalidConfiguration("kealib requires hdf5 with cxx and hl enabled.")
Expand Down

0 comments on commit eaaa5f2

Please sign in to comment.