Skip to content

Commit e0d017d

Browse files
authored
Upgrade to abseil-cpp 20240722.0 (#23)
* sync abseil-cpp 20240722.0 code * remove tests and benchmarks * remove status_matchers * remove cctz timezone data * remove BUILD.bazel and CMakeLists.txt * remove copts
1 parent 140793c commit e0d017d

File tree

834 files changed

+8865
-22490
lines changed

Some content is hidden

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

834 files changed

+8865
-22490
lines changed

Diff for: BUILD.bazel

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#
21
# Copyright 2020 The Abseil Authors.
32
#
43
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,3 +22,14 @@ exports_files([
2322
"AUTHORS",
2423
"LICENSE",
2524
])
25+
26+
# For building with clang-cl.
27+
# https://bazel.build/configure/windows#clang
28+
platform(
29+
name = "x64_windows-clang-cl",
30+
constraint_values = [
31+
"@platforms//cpu:x86_64",
32+
"@platforms//os:windows",
33+
"@bazel_tools//tools/cpp:clang-cl",
34+
],
35+
)

Diff for: CMake/AbseilDll.cmake

+88-15
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ set(ABSL_INTERNAL_DLL_FILES
2828
"base/internal/low_level_scheduling.h"
2929
"base/internal/nullability_impl.h"
3030
"base/internal/per_thread_tls.h"
31+
"base/internal/poison.cc"
32+
"base/internal/poison.h"
3133
"base/prefetch.h"
3234
"base/internal/pretty_function.h"
3335
"base/internal/raw_logging.cc"
@@ -66,6 +68,7 @@ set(ABSL_INTERNAL_DLL_FILES
6668
"cleanup/internal/cleanup.h"
6769
"container/btree_map.h"
6870
"container/btree_set.h"
71+
"container/hash_container_defaults.h"
6972
"container/fixed_array.h"
7073
"container/flat_hash_map.h"
7174
"container/flat_hash_set.h"
@@ -121,8 +124,13 @@ set(ABSL_INTERNAL_DLL_FILES
121124
"debugging/symbolize.h"
122125
"debugging/internal/address_is_readable.cc"
123126
"debugging/internal/address_is_readable.h"
127+
"debugging/internal/bounded_utf8_length_sequence.h"
128+
"debugging/internal/decode_rust_punycode.cc"
129+
"debugging/internal/decode_rust_punycode.h"
124130
"debugging/internal/demangle.cc"
125131
"debugging/internal/demangle.h"
132+
"debugging/internal/demangle_rust.cc"
133+
"debugging/internal/demangle_rust.h"
126134
"debugging/internal/elf_mem_image.cc"
127135
"debugging/internal/elf_mem_image.h"
128136
"debugging/internal/examine_stack.cc"
@@ -131,6 +139,8 @@ set(ABSL_INTERNAL_DLL_FILES
131139
"debugging/internal/stack_consumption.h"
132140
"debugging/internal/stacktrace_config.h"
133141
"debugging/internal/symbolize.h"
142+
"debugging/internal/utf8_for_code_point.cc"
143+
"debugging/internal/utf8_for_code_point.h"
134144
"debugging/internal/vdso_support.cc"
135145
"debugging/internal/vdso_support.h"
136146
"functional/any_invocable.h"
@@ -311,7 +321,6 @@ set(ABSL_INTERNAL_DLL_FILES
311321
"strings/internal/string_constant.h"
312322
"strings/internal/stringify_sink.h"
313323
"strings/internal/stringify_sink.cc"
314-
"strings/internal/has_absl_stringify.h"
315324
"strings/has_absl_stringify.h"
316325
"strings/has_ostream_operator.h"
317326
"strings/match.cc"
@@ -437,9 +446,47 @@ set(ABSL_INTERNAL_DLL_FILES
437446
"debugging/leak_check.cc"
438447
)
439448

449+
if(NOT MSVC)
450+
list(APPEND ABSL_INTERNAL_DLL_FILES
451+
"flags/commandlineflag.cc"
452+
"flags/commandlineflag.h"
453+
"flags/config.h"
454+
"flags/declare.h"
455+
"flags/flag.h"
456+
"flags/internal/commandlineflag.cc"
457+
"flags/internal/commandlineflag.h"
458+
"flags/internal/flag.cc"
459+
"flags/internal/flag.h"
460+
"flags/internal/parse.h"
461+
"flags/internal/path_util.h"
462+
"flags/internal/private_handle_accessor.cc"
463+
"flags/internal/private_handle_accessor.h"
464+
"flags/internal/program_name.cc"
465+
"flags/internal/program_name.h"
466+
"flags/internal/registry.h"
467+
"flags/internal/sequence_lock.h"
468+
"flags/internal/usage.cc"
469+
"flags/internal/usage.h"
470+
"flags/marshalling.cc"
471+
"flags/marshalling.h"
472+
"flags/parse.cc"
473+
"flags/parse.h"
474+
"flags/reflection.cc"
475+
"flags/reflection.h"
476+
"flags/usage.cc"
477+
"flags/usage.h"
478+
"flags/usage_config.cc"
479+
"flags/usage_config.h"
480+
"log/flags.cc"
481+
"log/flags.h"
482+
"log/internal/flags.h"
483+
)
484+
endif()
485+
440486
set(ABSL_INTERNAL_DLL_TARGETS
441487
"absl_check"
442488
"absl_log"
489+
"absl_vlog_is_on"
443490
"algorithm"
444491
"algorithm_container"
445492
"any"
@@ -505,6 +552,7 @@ set(ABSL_INTERNAL_DLL_TARGETS
505552
"log_internal_check_op"
506553
"log_internal_conditions"
507554
"log_internal_config"
555+
"log_internal_fnmatch"
508556
"log_internal_format"
509557
"log_internal_globals"
510558
"log_internal_log_impl"
@@ -584,6 +632,7 @@ set(ABSL_INTERNAL_DLL_TARGETS
584632
"strerror"
585633
"strings"
586634
"strings_internal"
635+
"string_view"
587636
"symbolize"
588637
"synchronization"
589638
"thread_pool"
@@ -594,8 +643,30 @@ set(ABSL_INTERNAL_DLL_TARGETS
594643
"type_traits"
595644
"utility"
596645
"variant"
646+
"vlog_config_internal"
647+
"vlog_is_on"
597648
)
598649

650+
if(NOT MSVC)
651+
list(APPEND ABSL_INTERNAL_DLL_TARGETS
652+
"flags"
653+
"flags_commandlineflag"
654+
"flags_commandlineflag_internal"
655+
"flags_config"
656+
"flags_internal"
657+
"flags_marshalling"
658+
"flags_parse"
659+
"flags_path_util"
660+
"flags_private_handle_accessor"
661+
"flags_program_name"
662+
"flags_reflection"
663+
"flags_usage"
664+
"flags_usage_internal"
665+
"log_internal_flags"
666+
"log_flags"
667+
)
668+
endif()
669+
599670
set(ABSL_INTERNAL_TEST_DLL_FILES
600671
"hash/hash_testing.h"
601672
"log/scoped_mock_log.cc"
@@ -608,6 +679,9 @@ set(ABSL_INTERNAL_TEST_DLL_FILES
608679
"random/internal/mock_overload_set.h"
609680
"random/mocking_bit_gen.h"
610681
"random/mock_distributions.h"
682+
"status/status_matchers.h"
683+
"status/internal/status_matchers.cc"
684+
"status/internal/status_matchers.h"
611685
"strings/cordz_test_helpers.h"
612686
"strings/cord_test_helpers.h"
613687
)
@@ -620,6 +694,7 @@ set(ABSL_INTERNAL_TEST_DLL_TARGETS
620694
"random_internal_distribution_test_util"
621695
"random_internal_mock_overload_set"
622696
"scoped_mock_log"
697+
"status_matchers"
623698
)
624699

625700
include(CheckCXXSourceCompiles)
@@ -668,12 +743,7 @@ function(absl_internal_dll_contains)
668743

669744
STRING(REGEX REPLACE "^absl::" "" _target ${ABSL_INTERNAL_DLL_TARGET})
670745

671-
list(FIND
672-
ABSL_INTERNAL_DLL_TARGETS
673-
"${_target}"
674-
_index)
675-
676-
if (${_index} GREATER -1)
746+
if (_target IN_LIST ABSL_INTERNAL_DLL_TARGETS)
677747
set(${ABSL_INTERNAL_DLL_OUTPUT} 1 PARENT_SCOPE)
678748
else()
679749
set(${ABSL_INTERNAL_DLL_OUTPUT} 0 PARENT_SCOPE)
@@ -690,12 +760,7 @@ function(absl_internal_test_dll_contains)
690760

691761
STRING(REGEX REPLACE "^absl::" "" _target ${ABSL_INTERNAL_TEST_DLL_TARGET})
692762

693-
list(FIND
694-
ABSL_INTERNAL_TEST_DLL_TARGETS
695-
"${_target}"
696-
_index)
697-
698-
if (${_index} GREATER -1)
763+
if (_target IN_LIST ABSL_INTERNAL_TEST_DLL_TARGETS)
699764
set(${ABSL_INTERNAL_TEST_DLL_OUTPUT} 1 PARENT_SCOPE)
700765
else()
701766
set(${ABSL_INTERNAL_TEST_DLL_OUTPUT} 0 PARENT_SCOPE)
@@ -747,7 +812,12 @@ function(absl_make_dll)
747812
else()
748813
set(_dll "abseil_dll")
749814
set(_dll_files ${ABSL_INTERNAL_DLL_FILES})
750-
set(_dll_libs "")
815+
set(_dll_libs
816+
Threads::Threads
817+
# TODO(#1495): Use $<LINK_LIBRARY:FRAMEWORK,CoreFoundation> once our
818+
# minimum CMake version >= 3.24
819+
$<$<PLATFORM_ID:Darwin>:-Wl,-framework,CoreFoundation>
820+
)
751821
set(_dll_compile_definitions "")
752822
set(_dll_includes "")
753823
set(_dll_consume "ABSL_CONSUME_DLL")
@@ -765,7 +835,10 @@ function(absl_make_dll)
765835
${_dll_libs}
766836
${ABSL_DEFAULT_LINKOPTS}
767837
)
768-
set_property(TARGET ${_dll} PROPERTY LINKER_LANGUAGE "CXX")
838+
set_target_properties(${_dll} PROPERTIES
839+
LINKER_LANGUAGE "CXX"
840+
SOVERSION ${ABSL_SOVERSION}
841+
)
769842
target_include_directories(
770843
${_dll}
771844
PUBLIC

Diff for: CMake/AbseilHelpers.cmake

+17-2
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,16 @@ function(absl_cc_library)
186186
endif()
187187
endif()
188188
endforeach()
189+
set(skip_next_cflag OFF)
189190
foreach(cflag ${ABSL_CC_LIB_COPTS})
190-
if(${cflag} MATCHES "^(-Wno|/wd)")
191+
if(skip_next_cflag)
192+
set(skip_next_cflag OFF)
193+
elseif(${cflag} MATCHES "^-Xarch_")
194+
# 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)")
191199
# These flags are needed to suppress warnings that might fire in our headers.
192200
set(PC_CFLAGS "${PC_CFLAGS} ${cflag}")
193201
elseif(${cflag} MATCHES "^(-W|/w[1234eo])")
@@ -250,6 +258,13 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
250258
elseif(_build_type STREQUAL "static" OR _build_type STREQUAL "shared")
251259
add_library(${_NAME} "")
252260
target_sources(${_NAME} PRIVATE ${ABSL_CC_LIB_SRCS} ${ABSL_CC_LIB_HDRS})
261+
if(APPLE)
262+
set_target_properties(${_NAME} PROPERTIES
263+
INSTALL_RPATH "@loader_path")
264+
elseif(UNIX)
265+
set_target_properties(${_NAME} PROPERTIES
266+
INSTALL_RPATH "$ORIGIN")
267+
endif()
253268
target_link_libraries(${_NAME}
254269
PUBLIC ${ABSL_CC_LIB_DEPS}
255270
PRIVATE
@@ -298,7 +313,7 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
298313
if(ABSL_ENABLE_INSTALL)
299314
set_target_properties(${_NAME} PROPERTIES
300315
OUTPUT_NAME "absl_${_NAME}"
301-
SOVERSION "2401.0.0"
316+
SOVERSION "${ABSL_SOVERSION}"
302317
)
303318
endif()
304319
else()

Diff for: CMake/Googletest/CMakeLists.txt.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.10)
1+
cmake_minimum_required(VERSION 3.16)
22

33
project(googletest-external NONE)
44

Diff for: CMake/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ section of your executable or of your library.<br>
3939
Here is a short CMakeLists.txt example of an application project using Abseil.
4040

4141
```cmake
42-
cmake_minimum_required(VERSION 3.10)
42+
cmake_minimum_required(VERSION 3.16)
4343
project(my_app_project)
4444
4545
# Pick the C++ standard to compile with.
@@ -62,7 +62,7 @@ will control Abseil library targets) is set to at least that minimum. For
6262
example:
6363

6464
```cmake
65-
cmake_minimum_required(VERSION 3.10)
65+
cmake_minimum_required(VERSION 3.16)
6666
project(my_lib_project)
6767
6868
# Leave C++ standard up to the root application, so set it only if this is the

Diff for: CMake/install_test_project/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
# A simple CMakeLists.txt for testing cmake installation
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.16)
1919
project(absl_cmake_testing CXX)
2020

2121
add_executable(simple simple.cc)

Diff for: CMake/install_test_project/test.sh

+5-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ set -euox pipefail
2222
absl_dir=/abseil-cpp
2323
absl_build_dir=/buildfs
2424
googletest_builddir=/googletest_builddir
25-
project_dir="${absl_dir}"/CMake/install_test_project
25+
googletest_archive="googletest-${ABSL_GOOGLETEST_VERSION}.tar.gz"
26+
project_dir="${absl_dir}/CMake/install_test_project"
2627
project_build_dir=/buildfs/project-build
2728

2829
build_shared_libs="OFF"
@@ -33,9 +34,9 @@ fi
3334
# Build and install GoogleTest
3435
mkdir "${googletest_builddir}"
3536
pushd "${googletest_builddir}"
36-
curl -L "${ABSL_GOOGLETEST_DOWNLOAD_URL}" --output "${ABSL_GOOGLETEST_COMMIT}".zip
37-
unzip "${ABSL_GOOGLETEST_COMMIT}".zip
38-
pushd "googletest-${ABSL_GOOGLETEST_COMMIT}"
37+
curl -L "${ABSL_GOOGLETEST_DOWNLOAD_URL}" --output "${googletest_archive}"
38+
tar -xz -f "${googletest_archive}"
39+
pushd "googletest-${ABSL_GOOGLETEST_VERSION}"
3940
mkdir build
4041
pushd build
4142
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS="${build_shared_libs}" ..

0 commit comments

Comments
 (0)