Skip to content

Commit

Permalink
check glibc 2.27 or later
Browse files Browse the repository at this point in the history
  • Loading branch information
toge committed May 22, 2024
1 parent 4d16aea commit 76a6437
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions recipes/objectbox/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.scm import Version
import os
import platform

required_conan_version = ">=1.53.0"

Expand Down Expand Up @@ -34,6 +35,8 @@ def validate(self):
if Version(self.version) >= "0.19.0" and \
self.settings.compiler == "gcc" and Version(self.settings.compiler.version) <= "5":
raise ConanInvalidConfiguration(f"{self.ref} requires GCC 6 or higher")
if Version(self.version) >= "4.0.0" and self._is_glibc_older_than_2_27_on_linux:
raise ConanInvalidConfiguration(f"{self.ref} requires glibc>=2.27")

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
Expand Down Expand Up @@ -62,3 +65,12 @@ def package_info(self):
self.cpp_info.system_libs.extend(["m", "pthread"])
if Version(self.version) >= "0.18.0":
self.cpp_info.system_libs.append("dl")

@property
def _is_glibc_older_than_2_27_on_linux(self):
libver = platform.libc_ver()
return (
self.settings.os == 'Linux' and
libver[0] == 'glibc' and
Version(libver[1]) < '2.27'
)

0 comments on commit 76a6437

Please sign in to comment.