From eaaa5f239b836f659471dcee8e24fe3db6ecdff8 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 6 Nov 2023 17:19:36 +0200 Subject: [PATCH] kealib: require GCC 6+ --- recipes/kealib/all/conanfile.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/recipes/kealib/all/conanfile.py b/recipes/kealib/all/conanfile.py index 78b54bda852ec1..52b359cb47ac3a 100644 --- a/recipes/kealib/all/conanfile.py +++ b/recipes/kealib/all/conanfile.py @@ -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" @@ -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) @@ -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.")