From 15fd296c3c16efb7c0003717569c5a010bc7e142 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 9 Oct 2024 15:22:50 +0900 Subject: [PATCH] 5.4.0 requires C++17 due to using --- recipes/libxmlpp/all/conanfile.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/recipes/libxmlpp/all/conanfile.py b/recipes/libxmlpp/all/conanfile.py index b79b459f36df3..d94023c853a29 100644 --- a/recipes/libxmlpp/all/conanfile.py +++ b/recipes/libxmlpp/all/conanfile.py @@ -34,6 +34,22 @@ class LibXMLPlusPlus(ConanFile): "fPIC": True, } + @property + def _min_cppstd(self): + return "17" if Version(self.version) < "5.4.0" else "11" + + @property + def _compilers_minimum_version(self): + return { + "17": { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + }, + }.get(self._min_cppstd, {}) + @property def _lib_version(self): return "2.6" if Version(self.version) <= "2.42.1" else "5.0" @@ -72,7 +88,12 @@ def validate(self): # INFO: error: no template named 'auto_ptr' in namespace 'std'. Removed in C++17. check_max_cppstd(self, 14) if self.settings.compiler.get_safe("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." + ) def build_requirements(self): self.tool_requires("meson/1.3.1")