Skip to content

Commit

Permalink
Import abseil-cpp source tag 20240116.1 (#22)
Browse files Browse the repository at this point in the history
* Import abseil-cpp source tag 20240116.1

* Fix nested redundant include for int128.h
  • Loading branch information
HannahShiSFB authored Feb 15, 2024
1 parent 421664c commit 140793c
Show file tree
Hide file tree
Showing 281 changed files with 8,887 additions and 9,916 deletions.
51 changes: 33 additions & 18 deletions CMake/AbseilDll.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ set(ABSL_INTERNAL_DLL_FILES
"base/internal/low_level_scheduling.h"
"base/internal/nullability_impl.h"
"base/internal/per_thread_tls.h"
"base/internal/prefetch.h"
"base/prefetch.h"
"base/internal/pretty_function.h"
"base/internal/raw_logging.cc"
Expand All @@ -44,7 +43,6 @@ set(ABSL_INTERNAL_DLL_FILES
"base/internal/spinlock_wait.h"
"base/internal/sysinfo.cc"
"base/internal/sysinfo.h"
"base/internal/thread_annotations.h"
"base/internal/thread_identity.cc"
"base/internal/thread_identity.h"
"base/internal/throw_delegate.cc"
Expand All @@ -57,6 +55,7 @@ set(ABSL_INTERNAL_DLL_FILES
"base/log_severity.cc"
"base/log_severity.h"
"base/macros.h"
"base/no_destructor.h"
"base/nullability.h"
"base/optimization.h"
"base/options.h"
Expand All @@ -77,7 +76,6 @@ set(ABSL_INTERNAL_DLL_FILES
"container/internal/common_policy_traits.h"
"container/internal/compressed_tuple.h"
"container/internal/container_memory.h"
"container/internal/counting_allocator.h"
"container/internal/hash_function_defaults.h"
"container/internal/hash_policy_traits.h"
"container/internal/hashtable_debug.h"
Expand Down Expand Up @@ -109,7 +107,7 @@ set(ABSL_INTERNAL_DLL_FILES
"crc/internal/crc_x86_arm_combined.cc"
"crc/internal/crc_memcpy_fallback.cc"
"crc/internal/crc_memcpy.h"
"crc/internal/crc_memcpy_x86_64.cc"
"crc/internal/crc_memcpy_x86_arm_combined.cc"
"crc/internal/crc_non_temporal_memcpy.cc"
"crc/internal/crc_x86_arm_combined.cc"
"crc/internal/non_temporal_arm_intrinsics.h"
Expand Down Expand Up @@ -141,6 +139,7 @@ set(ABSL_INTERNAL_DLL_FILES
"functional/function_ref.h"
"functional/internal/any_invocable.h"
"functional/internal/function_ref.h"
"functional/overload.h"
"hash/hash.h"
"hash/internal/city.h"
"hash/internal/city.cc"
Expand All @@ -151,6 +150,7 @@ set(ABSL_INTERNAL_DLL_FILES
"hash/internal/low_level_hash.cc"
"log/absl_check.h"
"log/absl_log.h"
"log/absl_vlog_is_on.h"
"log/check.h"
"log/die_if_null.cc"
"log/die_if_null.h"
Expand All @@ -163,6 +163,8 @@ set(ABSL_INTERNAL_DLL_FILES
"log/internal/conditions.cc"
"log/internal/conditions.h"
"log/internal/config.h"
"log/internal/fnmatch.h"
"log/internal/fnmatch.cc"
"log/internal/globals.cc"
"log/internal/globals.h"
"log/internal/log_format.cc"
Expand All @@ -179,6 +181,8 @@ set(ABSL_INTERNAL_DLL_FILES
"log/internal/proto.cc"
"log/internal/strip.h"
"log/internal/structured.h"
"log/internal/vlog_config.cc"
"log/internal/vlog_config.h"
"log/internal/voidify.h"
"log/initialize.cc"
"log/initialize.h"
Expand All @@ -190,6 +194,7 @@ set(ABSL_INTERNAL_DLL_FILES
"log/log_sink_registry.h"
"log/log_streamer.h"
"log/structured.h"
"log/vlog_is_on.h"
"memory/memory.h"
"meta/type_traits.h"
"numeric/bits.h"
Expand Down Expand Up @@ -250,6 +255,7 @@ set(ABSL_INTERNAL_DLL_FILES
"random/uniform_real_distribution.h"
"random/zipf_distribution.h"
"status/internal/status_internal.h"
"status/internal/status_internal.cc"
"status/internal/statusor_internal.h"
"status/status.h"
"status/status.cc"
Expand All @@ -261,6 +267,7 @@ set(ABSL_INTERNAL_DLL_FILES
"strings/ascii.h"
"strings/charconv.cc"
"strings/charconv.h"
"strings/charset.h"
"strings/cord.cc"
"strings/cord.h"
"strings/cord_analysis.cc"
Expand All @@ -287,9 +294,6 @@ set(ABSL_INTERNAL_DLL_FILES
"strings/internal/cord_rep_consume.h"
"strings/internal/cord_rep_consume.cc"
"strings/internal/cord_rep_flat.h"
"strings/internal/cord_rep_ring.cc"
"strings/internal/cord_rep_ring.h"
"strings/internal/cord_rep_ring_reader.h"
"strings/internal/cordz_functions.cc"
"strings/internal/cordz_functions.h"
"strings/internal/cordz_handle.cc"
Expand All @@ -308,6 +312,8 @@ set(ABSL_INTERNAL_DLL_FILES
"strings/internal/stringify_sink.h"
"strings/internal/stringify_sink.cc"
"strings/internal/has_absl_stringify.h"
"strings/has_absl_stringify.h"
"strings/has_ostream_operator.h"
"strings/match.cc"
"strings/match.h"
"strings/numbers.cc"
Expand All @@ -325,7 +331,6 @@ set(ABSL_INTERNAL_DLL_FILES
"strings/strip.h"
"strings/substitute.cc"
"strings/substitute.h"
"strings/internal/char_map.h"
"strings/internal/escaping.h"
"strings/internal/escaping.cc"
"strings/internal/memutil.cc"
Expand Down Expand Up @@ -421,11 +426,6 @@ set(ABSL_INTERNAL_DLL_FILES
"types/bad_variant_access.cc"
"types/bad_variant_access.h"
"types/compare.h"
"types/internal/conformance_aliases.h"
"types/internal/conformance_archetype.h"
"types/internal/conformance_profile.h"
"types/internal/parentheses.h"
"types/internal/transform_args.h"
"types/internal/variant.h"
"types/optional.h"
"types/internal/optional.h"
Expand Down Expand Up @@ -627,17 +627,32 @@ include(CheckCXXSourceCompiles)
check_cxx_source_compiles(
[==[
#ifdef _MSC_VER
# if _MSVC_LANG < 201700L
# if _MSVC_LANG < 201703L
# error "The compiler defaults or is configured for C++ < 17"
# endif
#elif __cplusplus < 201700L
#elif __cplusplus < 201703L
# error "The compiler defaults or is configured for C++ < 17"
#endif
int main() { return 0; }
]==]
ABSL_INTERNAL_AT_LEAST_CXX17)

if(ABSL_INTERNAL_AT_LEAST_CXX17)
check_cxx_source_compiles(
[==[
#ifdef _MSC_VER
# if _MSVC_LANG < 202002L
# error "The compiler defaults or is configured for C++ < 20"
# endif
#elif __cplusplus < 202002L
# error "The compiler defaults or is configured for C++ < 20"
#endif
int main() { return 0; }
]==]
ABSL_INTERNAL_AT_LEAST_CXX20)

if(ABSL_INTERNAL_AT_LEAST_CXX20)
set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_20)
elseif(ABSL_INTERNAL_AT_LEAST_CXX17)
set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_17)
else()
set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_14)
Expand Down Expand Up @@ -807,8 +822,8 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")

if(ABSL_PROPAGATE_CXX_STD)
# Abseil libraries require C++14 as the current minimum standard. When
# compiled with C++17 (either because it is the compiler's default or
# explicitly requested), then Abseil requires C++17.
# compiled with a higher minimum (either because it is the compiler's
# default or explicitly requested), then Abseil requires that standard.
target_compile_features(${_dll} PUBLIC ${ABSL_INTERNAL_CXX_STD_FEATURE})
endif()

Expand Down
8 changes: 4 additions & 4 deletions CMake/AbseilHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ endif()
# absl::fantastic_lib
# )
#
# TODO: Implement "ALWAYSLINK"
# TODO(b/320467376): Implement "ALWAYSLINK".
function(absl_cc_library)
cmake_parse_arguments(ABSL_CC_LIB
"DISABLE_INSTALL;PUBLIC;TESTONLY"
Expand Down Expand Up @@ -287,8 +287,8 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")

if(ABSL_PROPAGATE_CXX_STD)
# Abseil libraries require C++14 as the current minimum standard. When
# compiled with C++17 (either because it is the compiler's default or
# explicitly requested), then Abseil requires C++17.
# compiled with a higher standard (either because it is the compiler's
# default or explicitly requested), then Abseil requires that standard.
target_compile_features(${_NAME} PUBLIC ${ABSL_INTERNAL_CXX_STD_FEATURE})
endif()

Expand All @@ -298,7 +298,7 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
if(ABSL_ENABLE_INSTALL)
set_target_properties(${_NAME} PROPERTIES
OUTPUT_NAME "absl_${_NAME}"
SOVERSION "2308.0.0"
SOVERSION "2401.0.0"
)
endif()
else()
Expand Down
44 changes: 35 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ if (POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif (POLICY CMP0048)

# Honor the GTest_ROOT variable if specified
if (POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif (POLICY CMP0074)

# option() honor variables
if (POLICY CMP0077)
cmake_policy(SET CMP0077 NEW)
Expand All @@ -53,7 +58,7 @@ if (POLICY CMP0141)
cmake_policy(SET CMP0141 NEW)
endif (POLICY CMP0141)

project(absl LANGUAGES CXX VERSION 20230802)
project(absl LANGUAGES CXX VERSION 20240116)
include(CTest)

# Output directory is correct by default for most build setups. However, when
Expand Down Expand Up @@ -221,20 +226,41 @@ if(ABSL_ENABLE_INSTALL)
PATTERN "testdata" EXCLUDE
)

# Rewrite options.h to use the compiled ABI.
file(READ "absl/base/options.h" ABSL_INTERNAL_OPTIONS_H_CONTENTS)
if (ABSL_INTERNAL_AT_LEAST_CXX17)
string(REGEX REPLACE
"#define ABSL_OPTION_USE_STD_([^ ]*) 2"
"#define ABSL_OPTION_USE_STD_\\1 1"

# Handle features that require at least C++20.
if (ABSL_INTERNAL_AT_LEAST_CXX20)
foreach(FEATURE "ORDERING")
string(REPLACE
"#define ABSL_OPTION_USE_STD_${FEATURE} 2"
"#define ABSL_OPTION_USE_STD_${FEATURE} 1"
ABSL_INTERNAL_OPTIONS_H_PINNED
"${ABSL_INTERNAL_OPTIONS_H_CONTENTS}")
else()
string(REGEX REPLACE
"#define ABSL_OPTION_USE_STD_([^ ]*) 2"
"#define ABSL_OPTION_USE_STD_\\1 0"
set(ABSL_INTERNAL_OPTIONS_H_CONTENTS "${ABSL_INTERNAL_OPTIONS_H_PINNED}")
endforeach()
endif()

# Handle features that require at least C++17.
if (ABSL_INTERNAL_AT_LEAST_CXX17)
foreach(FEATURE "ANY" "OPTIONAL" "STRING_VIEW" "VARIANT")
string(REPLACE
"#define ABSL_OPTION_USE_STD_${FEATURE} 2"
"#define ABSL_OPTION_USE_STD_${FEATURE} 1"
ABSL_INTERNAL_OPTIONS_H_PINNED
"${ABSL_INTERNAL_OPTIONS_H_CONTENTS}")
set(ABSL_INTERNAL_OPTIONS_H_CONTENTS "${ABSL_INTERNAL_OPTIONS_H_PINNED}")
endforeach()
endif()

# Any feature that still has the value of 2 (because it was not handled above)
# should be set to 0.
string(REGEX REPLACE
"#define ABSL_OPTION_USE_STD_([^ ]*) 2"
"#define ABSL_OPTION_USE_STD_\\1 0"
ABSL_INTERNAL_OPTIONS_H_PINNED
"${ABSL_INTERNAL_OPTIONS_H_CONTENTS}")

file(WRITE "${CMAKE_BINARY_DIR}/options-pinned.h" "${ABSL_INTERNAL_OPTIONS_H_PINNED}")

install(FILES "${CMAKE_BINARY_DIR}/options-pinned.h"
Expand Down
39 changes: 39 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright 2024 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# https://bazel.build/external/overview#bzlmod

module(
name = "abseil-cpp",
version = "20240116.0",
compatibility_level = 1,
)

# Only direct dependencies need to be listed below.
# Please keep the versions in sync with the versions in the WORKSPACE file.

bazel_dep(name = "bazel_skylib",
version = "1.5.0")

bazel_dep(name = "google_benchmark",
version = "1.8.3",
repo_name = "com_github_google_benchmark",
dev_dependency = True)

bazel_dep(name = "googletest",
version = "1.14.0.bcr.1",
repo_name = "com_google_googletest")

bazel_dep(name = "platforms",
version = "0.0.8")
16 changes: 8 additions & 8 deletions PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyTracking</key>
<false/>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyAccessedAPITypes</key>
<array/>
<key>NSPrivacyTracking</key>
<false/>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyAccessedAPITypes</key>
<array/>
</dict>
</plist>
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
# Swift Package Manager copy repository

This repository is a copy of https://github.com/firebase/abseil-cpp with
the git metadata removed to provide one to two orders of magnitude increase in
speed for Swift Package Manager usage.

This repo is not supported as a direct dependency for non-Google usage.

There should be no changes to this repo other than updates from its mirror
and Swift Package Manager specific items.

# Abseil - C++ Common Libraries

The repository contains the Abseil C++ library code. Abseil is an open-source
Expand Down
Loading

0 comments on commit 140793c

Please sign in to comment.