Skip to content

Commit cfe057d

Browse files
authored
Merge pull request #28 from HannahShiSFB/update-to-20250127.1
Update to abseil-cpp 20250127.1
2 parents 9e639ab + 2c411c0 commit cfe057d

File tree

171 files changed

+3219
-4564
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+3219
-4564
lines changed

CMake/AbseilDll.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ set(ABSL_INTERNAL_DLL_FILES
4949
"base/internal/thread_identity.h"
5050
"base/internal/throw_delegate.cc"
5151
"base/internal/throw_delegate.h"
52+
"base/internal/tracing.cc"
53+
"base/internal/tracing.h"
5254
"base/internal/tsan_mutex_interface.h"
5355
"base/internal/unaligned_access.h"
5456
"base/internal/unscaledcycleclock.cc"
@@ -191,6 +193,8 @@ set(ABSL_INTERNAL_DLL_FILES
191193
"log/internal/proto.cc"
192194
"log/internal/strip.h"
193195
"log/internal/structured.h"
196+
"log/internal/structured_proto.cc"
197+
"log/internal/structured_proto.h"
194198
"log/internal/vlog_config.cc"
195199
"log/internal/vlog_config.h"
196200
"log/internal/voidify.h"
@@ -834,6 +838,7 @@ function(absl_make_dll)
834838
PRIVATE
835839
${_dll_libs}
836840
${ABSL_DEFAULT_LINKOPTS}
841+
$<$<BOOL:${ANDROID}>:-llog>
837842
)
838843
set_target_properties(${_dll} PROPERTIES
839844
LINKER_LANGUAGE "CXX"

CMake/AbseilHelpers.cmake

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -186,16 +186,16 @@ function(absl_cc_library)
186186
endif()
187187
endif()
188188
endforeach()
189-
set(skip_next_cflag OFF)
190189
foreach(cflag ${ABSL_CC_LIB_COPTS})
191-
if(skip_next_cflag)
192-
set(skip_next_cflag OFF)
193-
elseif(${cflag} MATCHES "^-Xarch_")
190+
# Strip out the CMake-specific `SHELL:` prefix, which is used to construct
191+
# a group of space-separated options.
192+
# https://cmake.org/cmake/help/v3.30/command/target_compile_options.html#option-de-duplication
193+
string(REGEX REPLACE "^SHELL:" "" cflag "${cflag}")
194+
if(${cflag} MATCHES "^-Xarch_")
194195
# An -Xarch_ flag implies that its successor only applies to the
195-
# specified platform. Filter both of them out before the successor
196-
# reaches the "^-m" filter.
197-
set(skip_next_cflag ON)
198-
elseif(${cflag} MATCHES "^(-Wno|/wd)")
196+
# specified platform. Such option groups are each specified in a single
197+
# `SHELL:`-prefixed string in the COPTS list, which we simply ignore.
198+
elseif(${cflag} MATCHES "^(-Wno-|/wd)")
199199
# These flags are needed to suppress warnings that might fire in our headers.
200200
set(PC_CFLAGS "${PC_CFLAGS} ${cflag}")
201201
elseif(${cflag} MATCHES "^(-W|/w[1234eo])")

CMakeLists.txt

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ if (POLICY CMP0141)
2323
cmake_policy(SET CMP0141 NEW)
2424
endif (POLICY CMP0141)
2525

26-
project(absl LANGUAGES CXX VERSION 20240722)
27-
set(ABSL_SOVERSION "2407.0.0")
26+
project(absl LANGUAGES CXX VERSION 20250127)
27+
set(ABSL_SOVERSION "2501.0.0")
2828
include(CTest)
2929

3030
# Output directory is correct by default for most build setups. However, when
@@ -47,10 +47,7 @@ set(CMAKE_BUILD_RPATH_USE_ORIGIN ON)
4747

4848
option(ABSL_PROPAGATE_CXX_STD
4949
"Use CMake C++ standard meta features (e.g. cxx_std_14) that propagate to targets that link to Abseil"
50-
OFF) # TODO: Default to ON for CMake 3.8 and greater.
51-
if(NOT ABSL_PROPAGATE_CXX_STD)
52-
message(WARNING "A future Abseil release will default ABSL_PROPAGATE_CXX_STD to ON for CMake 3.8 and up. We recommend enabling this option to ensure your project still builds correctly.")
53-
endif()
50+
ON)
5451

5552
option(ABSL_USE_SYSTEM_INCLUDES
5653
"Silence warnings in Abseil headers by marking them as SYSTEM includes"
@@ -204,11 +201,13 @@ if(ABSL_ENABLE_INSTALL)
204201
)
205202
endif() # absl_VERSION
206203

204+
# Install the headers except for "options.h" which is installed separately.
207205
install(DIRECTORY absl
208206
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
209207
FILES_MATCHING
210208
PATTERN "*.inc"
211209
PATTERN "*.h"
210+
PATTERN "options.h" EXCLUDE
212211
PATTERN "copts" EXCLUDE
213212
PATTERN "testdata" EXCLUDE
214213
)
@@ -248,7 +247,21 @@ if(ABSL_ENABLE_INSTALL)
248247
ABSL_INTERNAL_OPTIONS_H_PINNED
249248
"${ABSL_INTERNAL_OPTIONS_H_CONTENTS}")
250249

251-
file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/options-pinned.h" CONTENT "${ABSL_INTERNAL_OPTIONS_H_PINNED}")
250+
# If the file already exists, check if it matches the new contents.
251+
# This avoids writing the file if it is already up-to-date when the CMake
252+
# generation is triggered and triggering unnecessary rebuilds.
253+
set(ABSL_INTERNAL_OPTIONS_H_PINNED_NEEDS_UPDATE TRUE)
254+
if (EXISTS "${CMAKE_BINARY_DIR}/options-pinned.h")
255+
file(READ "${CMAKE_BINARY_DIR}/options-pinned.h" ABSL_INTERNAL_OPTIONS_PINNED_H_CONTENTS)
256+
if ("${ABSL_INTERNAL_OPTIONS_H_PINNED}" STREQUAL "${ABSL_INTERNAL_OPTIONS_PINNED_H_CONTENTS}")
257+
set(ABSL_INTERNAL_OPTIONS_H_PINNED_NEEDS_UPDATE FALSE)
258+
endif()
259+
endif()
260+
261+
# If the file needs an update, generate it.
262+
if (ABSL_INTERNAL_OPTIONS_H_PINNED_NEEDS_UPDATE)
263+
file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/options-pinned.h" CONTENT "${ABSL_INTERNAL_OPTIONS_H_PINNED}")
264+
endif()
252265

253266
install(FILES "${CMAKE_BINARY_DIR}/options-pinned.h"
254267
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/absl/base

MODULE.bazel

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,31 @@
1616

1717
module(
1818
name = "abseil-cpp",
19-
version = "20240722.0",
19+
version = "20250127.1",
2020
compatibility_level = 1,
2121
)
2222

23-
cc_configure = use_extension("@bazel_tools//tools/cpp:cc_configure.bzl", "cc_configure_extension")
23+
cc_configure = use_extension("@rules_cc//cc:extensions.bzl",
24+
"cc_configure_extension",
25+
dev_dependency = True)
2426
use_repo(cc_configure, "local_config_cc")
2527

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

29-
bazel_dep(name = "bazel_skylib",
30-
version = "1.5.0")
31+
bazel_dep(name = "rules_cc", version = "0.0.17")
32+
bazel_dep(name = "bazel_skylib", version = "1.7.1")
33+
bazel_dep(name = "platforms", version = "0.0.10")
3134

32-
bazel_dep(name = "google_benchmark",
33-
version = "1.8.3",
34-
repo_name = "com_github_google_benchmark",
35-
dev_dependency = True)
36-
37-
bazel_dep(name = "googletest",
38-
version = "1.15.2",
39-
repo_name = "com_google_googletest")
35+
bazel_dep(
36+
name = "google_benchmark",
37+
version = "1.8.5",
38+
dev_dependency = True,
39+
)
4040

41-
bazel_dep(name = "platforms",
42-
version = "0.0.10")
41+
# Note: Googletest is NOT a dev_dependency. Some Abseil test utilities
42+
# intended to be used by Abseil users depend on GoogleTest.
43+
bazel_dep(
44+
name = "googletest",
45+
version = "1.15.2",
46+
)

Package.swift

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,7 @@ let package = Package(
2020
path: ".",
2121
exclude: [
2222
// main functions
23-
"absl/base/c_header_test.c",
24-
"absl/hash/internal/print_hash_of.cc",
25-
"absl/random/internal/gaussian_distribution_gentables.cc",
26-
"absl/random/internal/randen_benchmarks.cc",
2723
// tests
28-
"absl/log/scoped_mock_log.cc",
29-
"absl/log/internal/test_helpers.cc",
30-
"absl/log/internal/test_matchers.cc",
31-
"absl/base/spinlock_test_common.cc",
32-
"absl/base/internal/exception_safety_testing.cc",
3324
"absl/random/benchmarks.cc",
3425
// .inc files
3526
"absl/debugging/internal/stacktrace_win32-inl.inc",
@@ -50,8 +41,6 @@ let package = Package(
5041
"absl/time/internal/get_current_time_posix.inc",
5142
"absl/numeric/int128_have_intrinsic.inc",
5243
"absl/numeric/int128_no_intrinsic.inc",
53-
"absl/log/log_basic_test_impl.inc",
54-
"absl/log/check_test_impl.inc",
5544
"absl/base/internal/spinlock_akaros.inc",
5645
"absl/base/internal/spinlock_linux.inc",
5746
"absl/base/internal/spinlock_posix.inc",

WORKSPACE

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,55 @@
1414
# limitations under the License.
1515
#
1616

17-
workspace(name = "com_google_absl")
17+
workspace(name = "abseil-cpp")
1818

1919
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2020

2121
# GoogleTest/GoogleMock framework. Used by most unit-tests.
2222
http_archive(
23-
name = "com_google_googletest",
23+
name = "googletest",
2424
sha256 = "7b42b4d6ed48810c5362c265a17faebe90dc2373c885e5216439d37927f02926",
2525
strip_prefix = "googletest-1.15.2",
2626
# Keep this URL in sync with the version in ci/cmake_common.sh and
2727
# ci/windows_msvc_cmake.bat.
2828
urls = ["https://github.com/google/googletest/releases/download/v1.15.2/googletest-1.15.2.tar.gz"],
29+
# Now that Abseil is using the canonical names from the Bazel Central Registry, map
30+
# GoogleTest's old names to the new canonical names.
31+
repo_mapping = {
32+
"@com_google_absl": "@",
33+
"@com_googlesource_code_re2": "@re2",
34+
},
2935
)
3036

3137
# RE2 (the regular expression library used by GoogleTest)
3238
http_archive(
33-
name = "com_googlesource_code_re2",
39+
name = "re2",
3440
sha256 = "eb2df807c781601c14a260a507a5bb4509be1ee626024cb45acbd57cb9d4032b",
3541
strip_prefix = "re2-2024-07-02",
3642
urls = ["https://github.com/google/re2/releases/download/2024-07-02/re2-2024-07-02.tar.gz"],
37-
repo_mapping = {"@abseil-cpp": "@com_google_absl"},
3843
)
3944

4045
# Google benchmark.
4146
http_archive(
42-
name = "com_github_google_benchmark",
43-
sha256 = "6bc180a57d23d4d9515519f92b0c83d61b05b5bab188961f36ac7b06b0d9e9ce",
44-
strip_prefix = "benchmark-1.8.3",
45-
urls = ["https://github.com/google/benchmark/archive/refs/tags/v1.8.3.tar.gz"],
47+
name = "google_benchmark",
48+
sha256 = "d26789a2b46d8808a48a4556ee58ccc7c497fcd4c0af9b90197674a81e04798a",
49+
strip_prefix = "benchmark-1.8.5",
50+
urls = ["https://github.com/google/benchmark/archive/refs/tags/v1.8.5.tar.gz"],
4651
)
4752

4853
# Bazel Skylib.
4954
http_archive(
5055
name = "bazel_skylib",
51-
sha256 = "cd55a062e763b9349921f0f5db8c3933288dc8ba4f76dd9416aac68acee3cb94",
52-
urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz"],
56+
sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f",
57+
urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz"],
58+
)
59+
60+
# C++ rules for Bazel
61+
http_archive(
62+
name = "rules_cc",
63+
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.1.0/rules_cc-0.1.0.tar.gz"],
64+
sha256 = "4b12149a041ddfb8306a8fd0e904e39d673552ce82e4296e96fac9cbf0780e59",
65+
strip_prefix = "rules_cc-0.1.0",
5366
)
5467

5568
# Bazel platform rules.

absl/algorithm/algorithm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ using std::rotate;
5353
// n = (`last` - `first`) comparisons. A linear search over short containers
5454
// may be faster than a binary search, even when the container is sorted.
5555
template <typename InputIterator, typename EqualityComparable>
56-
bool linear_search(InputIterator first, InputIterator last,
57-
const EqualityComparable& value) {
56+
ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool linear_search(
57+
InputIterator first, InputIterator last, const EqualityComparable& value) {
5858
return std::find(first, last, value) != last;
5959
}
6060

0 commit comments

Comments
 (0)