Skip to content

Commit

Permalink
(conan-io#16812) libmysqlclient: move check_min_cppstd to validate_build
Browse files Browse the repository at this point in the history
* libmysqlclient: move check_min_cppstd to validate build

* libmysqlclient: move some logic back to validate()

* formatting
  • Loading branch information
jcar87 authored and pezy committed Jun 1, 2023
1 parent 2d30715 commit 099740f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions recipes/libmysqlclient/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,14 @@ def requirements(self):
if self.settings.os == "FreeBSD":
self.requires("libunwind/1.6.2")

def validate(self):
def validate_build(self):
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, self._min_cppstd)

if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True):
raise ConanInvalidConfiguration("Cross compilation not yet supported by the recipe. Contributions are welcomed.")

def validate(self):
def loose_lt_semver(v1, v2):
lv1 = [int(v) for v in v1.split(".")]
lv2 = [int(v) for v in v2.split(".")]
Expand All @@ -83,9 +87,6 @@ def loose_lt_semver(v1, v2):
if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version):
raise ConanInvalidConfiguration(f"{self.ref} requires {self.settings.compiler} {minimum_version} or newer")

if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True):
raise ConanInvalidConfiguration("Cross compilation not yet supported by the recipe. Contributions are welcomed.")

# Sice 8.0.17 this doesn't support shared library on MacOS.
# https://github.com/mysql/mysql-server/blob/mysql-8.0.17/cmake/libutils.cmake#L333-L335
if self.settings.compiler == "apple-clang" and self.options.shared:
Expand Down

0 comments on commit 099740f

Please sign in to comment.