Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

folly: add version 2024.11.11.00 #25838

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions recipes/folly/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"2024.11.11.00":
url: "https://github.com/facebook/folly/releases/download/v2024.11.11.00/folly-v2024.11.11.00.tar.gz"
sha256: "5aa23ce1772afae0416e886804935a44b6ccf3eec04b58003b8e2bf18c266b50"
"2024.08.12.00":
url: "https://github.com/facebook/folly/releases/download/v2024.08.12.00/folly-v2024.08.12.00.tar.gz"
sha256: "18d7be721721db547cb9c5dd5cc50df05cd88b0a8e683e3126ec6f9ce2c41c4d"
46 changes: 20 additions & 26 deletions recipes/folly/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import os


required_conan_version = ">=1.54.0"
required_conan_version = ">=2.4"


class FollyConan(ConanFile):
Expand All @@ -26,10 +26,12 @@ class FollyConan(ConanFile):
options = {
"shared": [True, False],
"fPIC": [True, False],
"with_libaio": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
"with_libaio": True,
}

@property
Expand All @@ -53,6 +55,8 @@ def export_sources(self):
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
if self.settings.os != "Linux":
del self.options.with_libaio

def configure(self):
if self.options.shared:
Expand Down Expand Up @@ -88,6 +92,10 @@ def requirements(self):
self.requires("liburing/2.6")
# INFO: Folly does not support fmt 11 on MSVC: https://github.com/facebook/folly/issues/2250
self.requires("fmt/10.2.1", transitive_headers=True, transitive_libs=True)
if self.options.get_safe("with_libaio"):
self.requires("libaio/0.3.113")
if Version(self.version) >= "2024.11.04":
self.requires("fast_float/6.1.5")

def build_requirements(self):
# INFO: Required due ZIP_LISTS CMake feature in conan_deps.cmake
Expand All @@ -106,8 +114,7 @@ def _required_boost_cmake_targets(self):
return [f"Boost::{comp}" for comp in self._required_boost_components]

def validate(self):
if self.settings.compiler.cppstd:
check_min_cppstd(self, self._min_cppstd)
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.")
Expand Down Expand Up @@ -197,6 +204,11 @@ def generate(self):
deps.set_property("xz_utils", "cmake_file_name", "LibLZMA")
deps.set_property("zlib", "cmake_file_name", "ZLIB")
deps.set_property("zstd", "cmake_file_name", "Zstd")
if self.options.get_safe("with_libaio"):
deps.set_property("libaio", "cmake_file_name", "LibAIO")
deps.set_property("libaio", "cmake_additional_variables_prefixes", ["LIBAIO"])
if Version(self.version) >= "2024.11.04":
deps.set_property("fast_float", "cmake_additional_variables_prefixes", ["FASTFLOAT"])
deps.generate()

def _patch_sources(self):
Expand Down Expand Up @@ -267,6 +279,11 @@ def package_info(self):
if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version.value) >= "11.0":
self.cpp_info.components["libfolly"].system_libs.append("c++abi")

if self.options.get_safe("with_libaio"):
self.cpp_info.components["libfolly"].requires.append("libaio::libaio")
if Version(self.version) >= "2024.11.04":
self.cpp_info.components["libfolly"].requires.append("fast_float::fast_float")

self.cpp_info.components["follybenchmark"].set_property("cmake_target_name", "Folly::follybenchmark")
self.cpp_info.components["follybenchmark"].set_property("pkg_config_name", "libfollybenchmark")
self.cpp_info.components["follybenchmark"].libs = ["follybenchmark"]
Expand All @@ -292,26 +309,3 @@ def package_info(self):
self.cpp_info.components["folly_exception_counter"].set_property("pkg_config_name", "libfolly_exception_counter")
self.cpp_info.components["folly_exception_counter"].libs = ["folly_exception_counter"]
self.cpp_info.components["folly_exception_counter"].requires = ["folly_exception_tracer"]

# TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed
self.cpp_info.filenames["cmake_find_package"] = "folly"
self.cpp_info.filenames["cmake_find_package_multi"] = "folly"
self.cpp_info.names["cmake_find_package"] = "Folly"
self.cpp_info.names["cmake_find_package_multi"] = "Folly"
self.cpp_info.components["libfolly"].names["cmake_find_package"] = "folly"
self.cpp_info.components["libfolly"].names["cmake_find_package_multi"] = "folly"

# TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed
self.cpp_info.components["follybenchmark"].names["cmake_find_package"] = "follybenchmark"
self.cpp_info.components["follybenchmark"].names["cmake_find_package_multi"] = "follybenchmark"
self.cpp_info.components["folly_test_util"].names["cmake_find_package"] = "folly_test_util"
self.cpp_info.components["folly_test_util"].names["cmake_find_package_multi"] = "folly_test_util"

if self.settings.os in ["Linux", "FreeBSD"]:
# TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed
self.cpp_info.components["folly_exception_tracer_base"].names["cmake_find_package"] = "folly_exception_tracer_base"
self.cpp_info.components["folly_exception_tracer_base"].names["cmake_find_package_multi"] = "folly_exception_tracer_base"
self.cpp_info.components["folly_exception_tracer"].names["cmake_find_package"] = "folly_exception_tracer"
self.cpp_info.components["folly_exception_tracer"].names["cmake_find_package_multi"] = "folly_exception_tracer"
self.cpp_info.components["folly_exception_counter"].names["cmake_find_package"] = "folly_exception_counter"
self.cpp_info.components["folly_exception_counter"].names["cmake_find_package_multi"] = "folly_exception_counter"
2 changes: 2 additions & 0 deletions recipes/folly/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
versions:
"2024.11.11.00":
folder: all
"2024.08.12.00":
folder: all