Skip to content
Merged
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
5 changes: 5 additions & 0 deletions CMake/AbseilDll.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ set(ABSL_INTERNAL_DLL_FILES
"base/internal/thread_identity.h"
"base/internal/throw_delegate.cc"
"base/internal/throw_delegate.h"
"base/internal/tracing.cc"
"base/internal/tracing.h"
"base/internal/tsan_mutex_interface.h"
"base/internal/unaligned_access.h"
"base/internal/unscaledcycleclock.cc"
Expand Down Expand Up @@ -191,6 +193,8 @@ set(ABSL_INTERNAL_DLL_FILES
"log/internal/proto.cc"
"log/internal/strip.h"
"log/internal/structured.h"
"log/internal/structured_proto.cc"
"log/internal/structured_proto.h"
"log/internal/vlog_config.cc"
"log/internal/vlog_config.h"
"log/internal/voidify.h"
Expand Down Expand Up @@ -834,6 +838,7 @@ function(absl_make_dll)
PRIVATE
${_dll_libs}
${ABSL_DEFAULT_LINKOPTS}
$<$<BOOL:${ANDROID}>:-llog>
)
set_target_properties(${_dll} PROPERTIES
LINKER_LANGUAGE "CXX"
Expand Down
16 changes: 8 additions & 8 deletions CMake/AbseilHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,16 @@ function(absl_cc_library)
endif()
endif()
endforeach()
set(skip_next_cflag OFF)
foreach(cflag ${ABSL_CC_LIB_COPTS})
if(skip_next_cflag)
set(skip_next_cflag OFF)
elseif(${cflag} MATCHES "^-Xarch_")
# Strip out the CMake-specific `SHELL:` prefix, which is used to construct
# a group of space-separated options.
# https://cmake.org/cmake/help/v3.30/command/target_compile_options.html#option-de-duplication
string(REGEX REPLACE "^SHELL:" "" cflag "${cflag}")
if(${cflag} MATCHES "^-Xarch_")
# An -Xarch_ flag implies that its successor only applies to the
# specified platform. Filter both of them out before the successor
# reaches the "^-m" filter.
set(skip_next_cflag ON)
elseif(${cflag} MATCHES "^(-Wno|/wd)")
# specified platform. Such option groups are each specified in a single
# `SHELL:`-prefixed string in the COPTS list, which we simply ignore.
elseif(${cflag} MATCHES "^(-Wno-|/wd)")
# These flags are needed to suppress warnings that might fire in our headers.
set(PC_CFLAGS "${PC_CFLAGS} ${cflag}")
elseif(${cflag} MATCHES "^(-W|/w[1234eo])")
Expand Down
27 changes: 20 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ if (POLICY CMP0141)
cmake_policy(SET CMP0141 NEW)
endif (POLICY CMP0141)

project(absl LANGUAGES CXX VERSION 20240722)
set(ABSL_SOVERSION "2407.0.0")
project(absl LANGUAGES CXX VERSION 20250127)
set(ABSL_SOVERSION "2501.0.0")
include(CTest)

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

option(ABSL_PROPAGATE_CXX_STD
"Use CMake C++ standard meta features (e.g. cxx_std_14) that propagate to targets that link to Abseil"
OFF) # TODO: Default to ON for CMake 3.8 and greater.
if(NOT ABSL_PROPAGATE_CXX_STD)
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.")
endif()
ON)

option(ABSL_USE_SYSTEM_INCLUDES
"Silence warnings in Abseil headers by marking them as SYSTEM includes"
Expand Down Expand Up @@ -204,11 +201,13 @@ if(ABSL_ENABLE_INSTALL)
)
endif() # absl_VERSION

# Install the headers except for "options.h" which is installed separately.
install(DIRECTORY absl
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING
PATTERN "*.inc"
PATTERN "*.h"
PATTERN "options.h" EXCLUDE
PATTERN "copts" EXCLUDE
PATTERN "testdata" EXCLUDE
)
Expand Down Expand Up @@ -248,7 +247,21 @@ if(ABSL_ENABLE_INSTALL)
ABSL_INTERNAL_OPTIONS_H_PINNED
"${ABSL_INTERNAL_OPTIONS_H_CONTENTS}")

file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/options-pinned.h" CONTENT "${ABSL_INTERNAL_OPTIONS_H_PINNED}")
# If the file already exists, check if it matches the new contents.
# This avoids writing the file if it is already up-to-date when the CMake
# generation is triggered and triggering unnecessary rebuilds.
set(ABSL_INTERNAL_OPTIONS_H_PINNED_NEEDS_UPDATE TRUE)
if (EXISTS "${CMAKE_BINARY_DIR}/options-pinned.h")
file(READ "${CMAKE_BINARY_DIR}/options-pinned.h" ABSL_INTERNAL_OPTIONS_PINNED_H_CONTENTS)
if ("${ABSL_INTERNAL_OPTIONS_H_PINNED}" STREQUAL "${ABSL_INTERNAL_OPTIONS_PINNED_H_CONTENTS}")
set(ABSL_INTERNAL_OPTIONS_H_PINNED_NEEDS_UPDATE FALSE)
endif()
endif()

# If the file needs an update, generate it.
if (ABSL_INTERNAL_OPTIONS_H_PINNED_NEEDS_UPDATE)
file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/options-pinned.h" CONTENT "${ABSL_INTERNAL_OPTIONS_H_PINNED}")
endif()

install(FILES "${CMAKE_BINARY_DIR}/options-pinned.h"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/absl/base
Expand Down
32 changes: 18 additions & 14 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,31 @@

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

cc_configure = use_extension("@bazel_tools//tools/cpp:cc_configure.bzl", "cc_configure_extension")
cc_configure = use_extension("@rules_cc//cc:extensions.bzl",
"cc_configure_extension",
dev_dependency = True)
use_repo(cc_configure, "local_config_cc")

# 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 = "rules_cc", version = "0.0.17")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "platforms", version = "0.0.10")

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

bazel_dep(name = "googletest",
version = "1.15.2",
repo_name = "com_google_googletest")
bazel_dep(
name = "google_benchmark",
version = "1.8.5",
dev_dependency = True,
)

bazel_dep(name = "platforms",
version = "0.0.10")
# Note: Googletest is NOT a dev_dependency. Some Abseil test utilities
# intended to be used by Abseil users depend on GoogleTest.
bazel_dep(
name = "googletest",
version = "1.15.2",
)
11 changes: 0 additions & 11 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,7 @@ let package = Package(
path: ".",
exclude: [
// main functions
"absl/base/c_header_test.c",
"absl/hash/internal/print_hash_of.cc",
"absl/random/internal/gaussian_distribution_gentables.cc",
"absl/random/internal/randen_benchmarks.cc",
// tests
"absl/log/scoped_mock_log.cc",
"absl/log/internal/test_helpers.cc",
"absl/log/internal/test_matchers.cc",
"absl/base/spinlock_test_common.cc",
"absl/base/internal/exception_safety_testing.cc",
"absl/random/benchmarks.cc",
// .inc files
"absl/debugging/internal/stacktrace_win32-inl.inc",
Expand All @@ -50,8 +41,6 @@ let package = Package(
"absl/time/internal/get_current_time_posix.inc",
"absl/numeric/int128_have_intrinsic.inc",
"absl/numeric/int128_no_intrinsic.inc",
"absl/log/log_basic_test_impl.inc",
"absl/log/check_test_impl.inc",
"absl/base/internal/spinlock_akaros.inc",
"absl/base/internal/spinlock_linux.inc",
"absl/base/internal/spinlock_posix.inc",
Expand Down
33 changes: 23 additions & 10 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -14,42 +14,55 @@
# limitations under the License.
#

workspace(name = "com_google_absl")
workspace(name = "abseil-cpp")

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

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

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

# Google benchmark.
http_archive(
name = "com_github_google_benchmark",
sha256 = "6bc180a57d23d4d9515519f92b0c83d61b05b5bab188961f36ac7b06b0d9e9ce",
strip_prefix = "benchmark-1.8.3",
urls = ["https://github.com/google/benchmark/archive/refs/tags/v1.8.3.tar.gz"],
name = "google_benchmark",
sha256 = "d26789a2b46d8808a48a4556ee58ccc7c497fcd4c0af9b90197674a81e04798a",
strip_prefix = "benchmark-1.8.5",
urls = ["https://github.com/google/benchmark/archive/refs/tags/v1.8.5.tar.gz"],
)

# Bazel Skylib.
http_archive(
name = "bazel_skylib",
sha256 = "cd55a062e763b9349921f0f5db8c3933288dc8ba4f76dd9416aac68acee3cb94",
urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz"],
sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f",
urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz"],
)

# C++ rules for Bazel
http_archive(
name = "rules_cc",
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.1.0/rules_cc-0.1.0.tar.gz"],
sha256 = "4b12149a041ddfb8306a8fd0e904e39d673552ce82e4296e96fac9cbf0780e59",
strip_prefix = "rules_cc-0.1.0",
)

# Bazel platform rules.
Expand Down
4 changes: 2 additions & 2 deletions absl/algorithm/algorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ using std::rotate;
// n = (`last` - `first`) comparisons. A linear search over short containers
// may be faster than a binary search, even when the container is sorted.
template <typename InputIterator, typename EqualityComparable>
bool linear_search(InputIterator first, InputIterator last,
const EqualityComparable& value) {
ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool linear_search(
InputIterator first, InputIterator last, const EqualityComparable& value) {
return std::find(first, last, value) != last;
}

Expand Down
Loading