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,15 @@
--- a/absl/strings/CMakeLists.txt
+++ b/absl/strings/CMakeLists.txt
@@ -31,9 +31,12 @@
PUBLIC
)
+find_library(LIBM m)
absl_cc_library(
NAME
strings
+ LINKOPTS
+ $<$<BOOL:${LIBM}>:-lm>
HDRS
"ascii.h"
"charconv.h"

View File

@@ -0,0 +1,15 @@
--- a/absl/strings/CMakeLists.txt
+++ b/absl/strings/CMakeLists.txt
@@ -32,9 +32,12 @@
PUBLIC
)
+find_library(LIBM m)
absl_cc_library(
NAME
strings
+ LINKOPTS
+ $<$<BOOL:${LIBM}>:-lm>
HDRS
"ascii.h"
"charconv.h"

View File

@@ -0,0 +1,15 @@
--- a/absl/strings/CMakeLists.txt
+++ b/absl/strings/CMakeLists.txt
@@ -14,9 +14,12 @@
# limitations under the License.
#
+find_library(LIBM m)
absl_cc_library(
NAME
strings
+ LINKOPTS
+ $<$<BOOL:${LIBM}>:-lm>
HDRS
"ascii.h"
"charconv.h"

View File

@@ -0,0 +1,10 @@
--- a/absl/container/CMakeLists.txt
+++ b/absl/container/CMakeLists.txt
@@ -213,6 +213,7 @@ absl_cc_library(
DEPS
absl::config
GTest::gmock
+ TESTONLY
)
absl_cc_test(

View File

@@ -0,0 +1,11 @@
--- a/absl/hash/internal/hash.h 2022-06-24 06:22:47.000000000 +1200
+++ b/absl/hash/internal/hash.h 2022-07-28 17:00:02.241173356 +1200
@@ -444,7 +444,7 @@
// On other platforms, we assume that pointers-to-members do not have
// padding.
#ifdef __cpp_lib_has_unique_object_representations
- static_assert(std::has_unique_object_representations_v<T C::*>);
+ static_assert(std::has_unique_object_representations<T C::*>::value);
#endif // __cpp_lib_has_unique_object_representations
return n;
#endif

View File

@@ -0,0 +1,40 @@
--- a/absl/synchronization/internal/pthread_waiter.h
+++ b/absl/synchronization/internal/pthread_waiter.h
@@ -16,7 +16,7 @@
#ifndef ABSL_SYNCHRONIZATION_INTERNAL_PTHREAD_WAITER_H_
#define ABSL_SYNCHRONIZATION_INTERNAL_PTHREAD_WAITER_H_
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(__MINGW32__)
#include <pthread.h>
#include "absl/base/config.h"
@@ -55,6 +55,6 @@ class PthreadWaiter : public WaiterCrtp<PthreadWaiter> {
ABSL_NAMESPACE_END
} // namespace absl
-#endif // ndef _WIN32
+#endif // !defined(_WIN32) && !defined(__MINGW32__)
#endif // ABSL_SYNCHRONIZATION_INTERNAL_PTHREAD_WAITER_H_
--- a/absl/synchronization/internal/win32_waiter.h
+++ b/absl/synchronization/internal/win32_waiter.h
@@ -20,7 +20,8 @@
#include <sdkddkver.h>
#endif
-#if defined(_WIN32) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
+#if defined(_WIN32) && !defined(__MINGW32__) && \
+ _WIN32_WINNT >= _WIN32_WINNT_VISTA
#include "absl/base/config.h"
#include "absl/synchronization/internal/kernel_timeout.h"
@@ -65,6 +66,7 @@ class Win32Waiter : public WaiterCrtp<Win32Waiter> {
ABSL_NAMESPACE_END
} // namespace absl
-#endif // defined(_WIN32) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
+#endif // defined(_WIN32) && !defined(__MINGW32__) &&
+ // _WIN32_WINNT >= _WIN32_WINNT_VISTA
#endif // ABSL_SYNCHRONIZATION_INTERNAL_WIN32_WAITER_H_

View File

@@ -0,0 +1,53 @@
From bb83aceacb554e79e7cd2404856f0be30bd00303 Mon Sep 17 00:00:00 2001
From: Derek Mauro <dmauro@google.com>
Date: Tue, 12 Mar 2024 08:33:40 -0700
Subject: [PATCH] Fix GCC7 C++17 build
GCC did not support <filesystem> until GCC8.
Fixes #1635
PiperOrigin-RevId: 615051227
Change-Id: If7cd5802ead40805b1ff1c3bdfc10ba6d2858ef0
---
absl/hash/hash_test.cc | 2 +-
absl/hash/internal/hash.h | 12 ++++++++++--
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/absl/hash/internal/hash.h b/absl/hash/internal/hash.h
index f4a94f9129f..b7d89b01807 100644
--- a/absl/hash/internal/hash.h
+++ b/absl/hash/internal/hash.h
@@ -24,6 +24,15 @@
#include <TargetConditionals.h>
#endif
+#include "absl/base/config.h"
+
+// For feature testing and determining which headers can be included.
+#if ABSL_INTERNAL_CPLUSPLUS_LANG >= 202002L
+#include <version>
+#else
+#include <ciso646>
+#endif
+
#include <algorithm>
#include <array>
#include <bitset>
@@ -47,7 +56,6 @@
#include <utility>
#include <vector>
-#include "absl/base/config.h"
#include "absl/base/internal/unaligned_access.h"
#include "absl/base/port.h"
#include "absl/container/fixed_array.h"
@@ -61,7 +69,7 @@
#include "absl/types/variant.h"
#include "absl/utility/utility.h"
-#if ABSL_INTERNAL_CPLUSPLUS_LANG >= 201703L && \
+#if defined(__cpp_lib_filesystem) && __cpp_lib_filesystem >= 201703L && \
!defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
#include <filesystem> // NOLINT
#endif