Skip to content

Commit

Permalink
cherry pick abseil
Browse files Browse the repository at this point in the history
Signed-off-by: Yellow Shine <[email protected]>
  • Loading branch information
yellow-shine committed Aug 6, 2024
1 parent e3b73e0 commit 4888b9f
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 117 deletions.
64 changes: 32 additions & 32 deletions abseil/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,29 @@
sources:
"20240116.2":
url: "https://github.com/abseil/abseil-cpp/archive/20240116.2.tar.gz"
sha256: "733726b8c3a6d39a4120d7e45ea8b41a434cdacde401cba500f14236c49b39dc"
"20240116.1":
url: "https://github.com/abseil/abseil-cpp/archive/20240116.1.tar.gz"
sha256: "3c743204df78366ad2eaf236d6631d83f6bc928d1705dd0000b872e53b73dc6a"
"20230802.1":
url: "https://github.com/abseil/abseil-cpp/archive/20230802.1.tar.gz"
sha256: "987ce98f02eefbaf930d6e38ab16aa05737234d7afbab2d5c4ea7adbe50c28ed"
"20230125.3":
url: "https://github.com/abseil/abseil-cpp/archive/20230125.3.tar.gz"
sha256: "5366D7E7FA7BA0D915014D387B66D0D002C03236448E1BA9EF98122C13B35C36"
"20230125.2":
url: "https://github.com/abseil/abseil-cpp/archive/20230125.2.tar.gz"
sha256: "9a2b5752d7bfade0bdeee2701de17c9480620f8b237e1964c1b9967c75374906"
"20230125.1":
url: "https://github.com/abseil/abseil-cpp/archive/20230125.1.tar.gz"
sha256: "81311c17599b3712069ded20cca09a62ab0bf2a89dfa16993786c8782b7ed145"
"20230125.0":
url: "https://github.com/abseil/abseil-cpp/archive/20230125.0.tar.gz"
sha256: "3ea49a7d97421b88a8c48a0de16c16048e17725c7ec0f1d3ea2683a2a75adc21"
"20220623.1":
url: "https://github.com/abseil/abseil-cpp/archive/20220623.1.tar.gz"
sha256: "91ac87d30cc6d79f9ab974c51874a704de9c2647c40f6932597329a282217ba8"
"20220623.0":
url: "https://github.com/abseil/abseil-cpp/archive/20220623.0.tar.gz"
sha256: "4208129b49006089ba1d6710845a45e31c59b0ab6bff9e5788a87f55c5abd602"
"20211102.0":
url: "https://github.com/abseil/abseil-cpp/archive/20211102.0.tar.gz"
sha256: "dcf71b9cba8dc0ca9940c4b316a0c796be8fab42b070bb6b7cab62b48f0e66c4"
patches:
"20240116.2":
- patch_file: "patches/0003-absl-string-libm-20240116.patch"
patch_description: "link libm to absl string"
patch_type: "portability"
patch_source: "https://github.com/abseil/abseil-cpp/issues/1100"
- patch_file: "patches/20240116.1-0001-fix-filesystem-include.patch"
patch_description: "Fix GCC 7 including <filesystem> in C++17 mode when it is not available (until GCC 8)"
patch_type: "portability"
patch_source: "https://github.com/abseil/abseil-cpp/commit/bb83aceacb554e79e7cd2404856f0be30bd00303"
- patch_file: "patches/0004-test-allocator-testonly.patch"
patch_description: "Do not build test_allocator target when tests are disabled"
patch_type: "portability"
patch_source: "https://github.com/abseil/abseil-cpp/commit/779a3565ac6c5b69dd1ab9183e500a27633117d5"
"20240116.1":
- patch_file: "patches/0003-absl-string-libm-20240116.patch"
patch_description: "link libm to absl string"
patch_type: "portability"
patch_source: "https://github.com/abseil/abseil-cpp/issues/1100"
- patch_file: "patches/20240116.1-0001-fix-filesystem-include.patch"
patch_description: "Fix GCC 7 including <filesystem> in C++17 mode when it is not available (until GCC 8)"
patch_type: "portability"
patch_source: "https://github.com/abseil/abseil-cpp/commit/bb83aceacb554e79e7cd2404856f0be30bd00303"
- patch_file: "patches/0004-test-allocator-testonly.patch"
patch_description: "Do not build test_allocator target when tests are disabled"
patch_type: "portability"
patch_source: "https://github.com/abseil/abseil-cpp/commit/779a3565ac6c5b69dd1ab9183e500a27633117d5"
"20230802.1":
- patch_file: "patches/0003-absl-string-libm-20230802.patch"
patch_description: "link libm to absl string"
Expand All @@ -57,6 +37,18 @@ patches:
- patch_file: "patches/0003-absl-string-libm.patch"
patch_description: "link libm to absl string"
patch_type: "portability"
"20230125.2":
- patch_file: "patches/0003-absl-string-libm.patch"
patch_description: "link libm to absl string"
patch_type: "portability"
"20230125.1":
- patch_file: "patches/0003-absl-string-libm.patch"
patch_description: "link libm to absl string"
patch_type: "portability"
"20230125.0":
- patch_file: "patches/0003-absl-string-libm.patch"
patch_description: "link libm to absl string"
patch_type: "portability"
"20220623.1":
- patch_file: "patches/0003-absl-string-libm.patch"
patch_description: "link libm to absl string"
Expand All @@ -65,6 +57,14 @@ patches:
patch_description: "Workaround bug in GCC 7.2"
patch_source: "https://github.com/abseil/abseil-cpp/pull/1250"
patch_type: "portability"
"20220623.0":
- patch_file: "patches/0003-absl-string-libm.patch"
patch_description: "link libm to absl string"
patch_type: "portability"
- patch_file: "patches/0005-has-unique-object-representations.patch"
patch_description: "Workaround bug in GCC 7.2"
patch_source: "https://github.com/abseil/abseil-cpp/pull/1250"
patch_type: "portability"
"20211102.0":
- patch_file: "patches/0003-absl-string-libm.patch"
patch_description: "link libm to absl string"
Expand Down
11 changes: 8 additions & 3 deletions abseil/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ def validate(self):
f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support."
)

if self.options.shared and is_msvc(self) and Version(self.version) < "20230802.1":
if self.options.shared and is_msvc(self):
# upstream tries its best to export symbols, but it's broken for the moment
raise ConanInvalidConfiguration(f"{self.ref} shared not availabe for Visual Studio, please use version 20230802.1 or newer")
raise ConanInvalidConfiguration(f"{self.ref} shared not availabe for Visual Studio (yet)")

def layout(self):
cmake_layout(self, src_folder="src")
Expand Down Expand Up @@ -161,7 +161,7 @@ def _load_components_from_cmake_target_file(self, absl_target_file_path):
if cmake_function_name == "add_library":
cmake_imported_target_type = cmake_function_args[1]
if cmake_imported_target_type in ["STATIC", "SHARED"]:
components[potential_lib_name]["libs"] = [potential_lib_name] if cmake_target_nonamespace != "abseil_dll" else ['abseil_dll']
components[potential_lib_name]["libs"] = [potential_lib_name] if cmake_target_nonamespace != "abseil_dll" else []
elif cmake_function_name == "set_target_properties":
target_properties = re.findall(r"(?P<property>INTERFACE_COMPILE_DEFINITIONS|INTERFACE_INCLUDE_DIRECTORIES|INTERFACE_LINK_LIBRARIES)[\n|\s]+(?P<values>.+)", cmake_function_args[2])
for target_property in target_properties:
Expand Down Expand Up @@ -232,6 +232,11 @@ def package_info(self):
self.cpp_info.components[pkgconfig_name].system_libs = values.get("system_libs", [])
self.cpp_info.components[pkgconfig_name].frameworks = values.get("frameworks", [])
self.cpp_info.components[pkgconfig_name].requires = values.get("requires", [])
if is_msvc(self) and self.settings.compiler.get_safe("cppstd") == "20":
self.cpp_info.components[pkgconfig_name].defines.extend([
"_HAS_DEPRECATED_RESULT_OF",
"_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING",
])

self.cpp_info.components[pkgconfig_name].names["cmake_find_package"] = cmake_target
self.cpp_info.components[pkgconfig_name].names["cmake_find_package_multi"] = cmake_target
Expand Down
15 changes: 0 additions & 15 deletions abseil/all/patches/0003-absl-string-libm-20240116.patch

This file was deleted.

10 changes: 0 additions & 10 deletions abseil/all/patches/0004-test-allocator-testonly.patch

This file was deleted.

53 changes: 0 additions & 53 deletions abseil/all/patches/20240116.1-0001-fix-filesystem-include.patch

This file was deleted.

12 changes: 8 additions & 4 deletions abseil/config.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
versions:
"20240116.2":
folder: all
"20240116.1":
folder: all
"20230802.1":
folder: all
"20230125.3":
folder: all
"20230125.2":
folder: all
"20230125.1":
folder: all
"20230125.0":
folder: all
"20220623.1":
folder: all
"20220623.0":
folder: all
"20211102.0":
folder: all

0 comments on commit 4888b9f

Please sign in to comment.