Skip to content

Commit

Permalink
5.4.0 requires C++17 due to using <variant>
Browse files Browse the repository at this point in the history
  • Loading branch information
toge committed Oct 9, 2024
1 parent a73b122 commit 15fd296
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion recipes/libxmlpp/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 15fd296

Please sign in to comment.