From b17da9246d95bdb660ba90483888e84e6acd816d Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 12 Jan 2025 22:26:43 +0200 Subject: [PATCH] g2o: simplify cppstd checks --- recipes/g2o/all/conanfile.py | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/recipes/g2o/all/conanfile.py b/recipes/g2o/all/conanfile.py index dd28d6616fa31..87701cc75944b 100644 --- a/recipes/g2o/all/conanfile.py +++ b/recipes/g2o/all/conanfile.py @@ -5,7 +5,6 @@ from conan.tools.build import check_min_cppstd, check_max_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import copy, get, rm, rmdir, save, export_conandata_patches, apply_conandata_patches, replace_in_file -from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -71,23 +70,6 @@ class G2oConan(ConanFile): "with_csparse": False, } - @property - def _min_cppstd(self): - return 17 - - @property - def _max_cppstd(self): - return 17 - - @property - def _compilers_minimum_version(self): - return { - "msvc": "192", - "gcc": "8", - "clang": "7", - "apple-clang": "12", - } - def export_sources(self): export_conandata_patches(self) copy(self, "FindSuiteSparse.cmake", self.recipe_folder, self.export_sources_folder) @@ -141,15 +123,10 @@ def requirements(self): # self.requires("libqglviewer/x.y.z") def validate(self): - check_min_cppstd(self, self._min_cppstd) + check_min_cppstd(self, 17) # C++20 fails with # error: call to non-‘constexpr’ function ‘void fmt::v10::detail::throw_format_error(const char*)’ - check_max_cppstd(self, self._max_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." - ) + check_max_cppstd(self, 17) if self.settings.os == "Windows" and self.options.shared: # Build fails with "unresolved external symbol "public: __cdecl g2o::internal::LoggerInterface::LoggerInterface(void)"