add abseil recipe

This commit is contained in:
aleksandr.vodyanov
2024-11-14 13:52:51 +03:00
commit 1853b851ff
17 changed files with 742 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
from conan import ConanFile
from conan.tools.build import cross_building
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.scm import Version
import os
class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "CMakeDeps", "VirtualRunEnv"
def requirements(self):
self.requires(self.tested_reference_str)
def layout(self):
cmake_layout(self)
def generate(self):
tc = CMakeToolchain(self)
tc.variables["CXX20_SUPPORTED"] = Version(self.dependencies["abseil"].ref.version) > "20210324.2"
tc.generate()
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def test(self):
if not cross_building(self):
bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package")
self.run(f"{bin_path} -s", env="conanrun")
bin_global_path = os.path.join(self.cpp.build.bindirs[0], "test_package_global")
self.run(f"{bin_global_path} -s", env="conanrun")