When using Abseil as a dependency with CMake, files that include Abseil headers and have incompatible warning settings can emit compiler warnings. CMake allows you to mark include directories as `SYSTEM` includes, which causes compilers to ignore warnings from those headers.
This adds the new option `ABSL_USE_SYSTEM_INCLUDES`, which makes Abseil's include directories be marked with `SYSTEM`.
Adds policy checks the raise the minimum C++ version to C++14
and the minimum GCC version to GCC 5
Updates the docs to indicate the C++14 minimum.
PiperOrigin-RevId: 459401288
Change-Id: I18878f0e13001c57e97e26ad7c9a9c9c12c39265
--
6d4e969ad240d248bfeb644b3b76fffae0f07882 by Christian Blichmann <cblichmann@google.com>:
cmake: Fix description of `ABSL_USE_EXTERNAL_GOOGLETEST` option
There is no `add_subproject()` in CMake.
PiperOrigin-RevId: 443087953
Change-Id: I30c2118638f99ad1389ae197e2c81d1e5f298882
GitOrigin-RevId: 6d4e969ad240d248bfeb644b3b76fffae0f07882
* cmake: use target aliases from local Google Test checkout.
`ABSL_FIND_GOOGLETEST` is a dependent option, it is always `OFF` when
`ABSL_USE_EXTERNAL_GOOGLETEST` is `OFF` (i.e. when Google Test is
checked out locally).
`GTest::` target aliases are to be added only if `find_package(GTest)`
has been actually used.
* cmake: clarify adding GTest:: aliases.
Abseil's own tests now are disabled if either BUILD_TESTING
or a new option called ABSL_BUILD_TESTING is false.
Additionally, Abseil's CMakeLists.txt no longer re-declares
the BUILD_TESTING option with a value of false.
Abseil had been using just the BUILD_TESTING option, since
the fix for #901. Because setting BUILD_TESTING false still
works to disable Abseil's tests, this change preserves the
behavior asked for in that issue.
Previous to that, Abseil had a project specific flag for
this, as is the typical idiom used in other projects.
The issue with BUILD_TESTING is that it is an all-or-nothing
policy. When Abseil is incorporated as a subproject, the
encompasing project has no convenient way to enable its own
tests while disabling Abseil's.
Fixes#1056
--
b008f3aaab60f1f0eb5987b50336543cca7151be by Martijn Vels <mvels@google.com>:
Enable Cord Btree as the default Cord implementation.
The Cord Btree implementation has been extensively tested by google. This changes makes the Cord Btree implementation the default implementation. This change should have no impact on current use cases and does not effect any public API or behavior.
PiperOrigin-RevId: 403966449
--
3d82052b5819d1244942c59d5cb4e51d75ada287 by Derek Mauro <dmauro@google.com>:
Add missing CMake alias for gmock_main.
Remove unused variable ABSL_TEST_COMMON_LIBRARIES
Fixes#709Fixes#1043
PiperOrigin-RevId: 403950358
--
86695f6d06915b56d807303c37ee81487998cd58 by Abseil Team <absl-team@google.com>:
FunctionRef is cheaper to construct than a std::function, and the argument is only used during the call, so this is safe. This has the added advantage of allowing the caller to provide a non-movable callable, which can't be converted to a std::function.
PiperOrigin-RevId: 403457615
--
196c1109ba519d4ff00c856bbb4bff754468359f by Abseil Team <absl-team@google.com>:
Internal optimization.
PiperOrigin-RevId: 403413291
GitOrigin-RevId: b008f3aaab60f1f0eb5987b50336543cca7151be
Change-Id: I1665f0efd484f53e0ed22d8940ef2fa60b03cc5b
See https://github.com/abseil/abseil-cpp/issues/259 for context.
This change introduces the ABSL_PROPAGATE_CXX_STD option (default to OFF for now, though it prints a warning in CMake 2.8+ builds that a future Abseil release will default to ON). When enabled, all Abseil CMake targets will set the cxx_std_11 target meta feature (which will then propagate to targets that depend upon Abseil) rather than setting the target-level CXX_STANDARD property to CMAKE_CXX_STANDARD (which is the default value anyway), which doesn't propagate.
Updates README documentation to clarify behavior and with a different example recommendation for library projects (which should generally leave CMAKE_CXX_STANDARD to the root application project).
See https://crascit.com/2015/03/28/enabling-cxx11-in-cmake/ for a useful overview of these different CMake features surrounding C++ standard version configuration.
As of this change, you can use `-DABSL_USE_EXTERNAL_GOOGLETEST=ON -DABSL_FIND_GOOGLETEST=ON` to have Abseil use the standard CMake find_package(GTest) mechanism.
* Allowing to change the MSVC runtime with the CMake option CMAKE_MSVC_RUNTIME_LIBRARY introduced in 3.15
* Update CMakeLists.txt
Capitalize MSVC
Co-authored-by: Derek Mauro <761129+derekmauro@users.noreply.github.com>
--
8e75347c10d85112296811be6ef35761744ad9bc by Derek Mauro <dmauro@google.com>:
Big update to LTS release process
* Add create_lts.py script to to the LTS modification
This is simpler than copybara since very few changes are needed
* Use the default installation paths instead of a versioned path.
If a versioned path is needed, this is easy to change on the commandline.
* Make the integration test use the LTS transformed version
* Test both static and dynamic linking (fixes pkg-config dynamic linking)
PiperOrigin-RevId: 363566934
--
e00e971a2de3138861f5e1900201c9cc7788f714 by Laramie Leavitt <lar@google.com>:
Add a non-compile test to absl::BitGenRef for temporaries.
PiperOrigin-RevId: 363437284
--
3685644ec115d99789de32aceb76c32a00756fea by Derek Mauro <dmauro@google.com>:
Make OSS code consistent with internal code by using the forward
declaration of absl::Status that contains ABSL_MUST_USE_RESULT.
PiperOrigin-RevId: 363426906
--
b85fec142c3aa3f632fa985f9f8f73a253819723 by Evan Brown <ezb@google.com>:
Move raw_hash_set::infoz_ into raw_hash_set::settings_. This reduces the size of raw_hash_sets by alignof(size_t) bytes when hashtablez is disabled.
PiperOrigin-RevId: 363034264
--
c6fde3b17e5845191eb8b2bfc1760c8bfb9573ff by Mark Barolak <mbar@google.com>:
Internal change
PiperOrigin-RevId: 362990378
--
81713cf964905b43d1cbe32ce5fed97539029625 by Abseil Team <absl-team@google.com>:
Fix typo in comment (execeptions -> exceptions).
PiperOrigin-RevId: 362946191
--
3ee92ca470feca44da417b03ee45a915c6eb5155 by Abseil Team <absl-team@google.com>:
Add absl::FindAndReportLeaks and routes it to the corresponding
__lsan_do_recoverable_leak_check.
PiperOrigin-RevId: 362622199
--
b95b7194b20e02c20d72289fbc79a0d35b82e256 by Abseil Team <absl-team@google.com>:
Add `kWithEverything` to StatusToStringMode
PiperOrigin-RevId: 362595218
--
0a960d96a0014eab7e1c55b479269450ed8e98d7 by Abseil Team <absl-team@google.com>:
Accept e.g. ".__uniq" as a valid clone name. Further, bring the implementation
on par with libiberty's demangler grammar.
Clang introduced option -funique-internal-linkage-names that adds the suffix
".__uniq.[0-9]+" to internal linkage functions to give them a globally unique
identifier. The suffix was designed to work with existing demanglers which do
recognize a "_" along with the alphanumeric string. This change enhances the
demangler to allow "_" with the alphanumeric string.
Please refer to libiberty's cp-demangle.c where function d_clone_suffix
implements the demangling of clone suffixes :
1. '_' is accepted as a valid character with the alphanumeric sequence.
2. The alphanumberic sequence is optional.
3. The digit sequence is optional.
PiperOrigin-RevId: 362557420
--
2ac5ea212c150afd2f58025a5cab8c45d16949c6 by Abseil Team <absl-team@google.com>:
Change variable name 'slots' to 'slot_count' to avoid name-clash with Qt builds.
PiperOrigin-RevId: 362556289
--
934f0f409c9c548716a46363d6e243406fad4028 by Mark Barolak <mbar@google.com>:
Clarify the comment on ABSL_CACHELINE_SIZE to indicate that the macro definition itself shouldn't change, but rather that call sites should change when possible.
This addresses the request for improved documentation in https://github.com/abseil/abseil-cpp/pull/842.
PiperOrigin-RevId: 362354288
GitOrigin-RevId: 8e75347c10d85112296811be6ef35761744ad9bc
Change-Id: I33ec8561d8d645c3353e9d2dd447501d0e1825a7
--
4ceae78ecef025a331985958bba12ce12d4d0a68 by Derek Mauro <dmauro@google.com>:
Internal change
PiperOrigin-RevId: 358888936
--
48f69b0b46e2041bb321e8af7374d7e0b45efc25 by Derek Mauro <dmauro@google.com>:
Use the standard CTest mechanism BUILD_TESTING for enabling/disabling tests
in CMake
Fixes#901
PiperOrigin-RevId: 358822190
GitOrigin-RevId: 4ceae78ecef025a331985958bba12ce12d4d0a68
Change-Id: Ib1ca69a42355f2a4cd4c7f5a47184c4fd8441f35
--
642ab296a2c9629c44f3f2ce6911cd2488bcf416 by Derek Mauro <dmauro@google.com>:
Remove an obsolete check in CMakeLists.txt
PiperOrigin-RevId: 352852564
--
ce78cb96bcfd162737dbcf35005da3d1d6a3486b by Abseil Team <absl-team@google.com>:
Clarify that the calling *thread* must have locked the mutex in order to unlock
it.
PiperOrigin-RevId: 352801804
--
24e1f5f72756046f5265abf618e951c341f09b8d by Derek Mauro <dmauro@google.com>:
Fixes failing CMake string comparisons
https://cmake.org/cmake/help/latest/policy/CMP0054.htmlFixes#791
PiperOrigin-RevId: 352791054
--
0ac10bc3f4dca2c4c4b51d7b8196a2eaee9537a1 by Abseil Team <absl-team@google.com>:
Introduce CordRepRing class
This change introduces the CordRepRing class that implements all the lower level / internal implementation for upcoming CordRepRing ring buffer support in cord.
PiperOrigin-RevId: 352771994
--
4bd36dda61760785844f0f29f26d90cc18046f75 by Abseil Team <absl-team@google.com>:
Optimize InlineData representation for cord sampling (cordz)
This CL changes InlineData to allow us to store a (future) Cordz Info pointer directly into the inline representation:
- make InlineData a class that provides a public API to set the active union members (tree or chars) and safely access that data.
- change 'tree' and 'profiled' bits to be the 2 least significant bits, allowing us 62 continquous bits for storing a Cordz Info pointer.
PiperOrigin-RevId: 352642411
--
dc55ba71bbce0e6a83e05a453990c51ac3d68426 by Mark Barolak <mbar@google.com>:
Add unit test coverage for the mutating overload of absl::AsciiStrToLower.
PiperOrigin-RevId: 352626006
GitOrigin-RevId: 642ab296a2c9629c44f3f2ce6911cd2488bcf416
Change-Id: I6c5929dd830d3c630e14e7fd5387fc3e25a69100
--
d09230db053c544c2dc7fd7d95d1ebe4302071e9 by Abseil Team <absl-team@google.com>:
Move testonly_uses_linear_node_search to BtreeNodePeer
PiperOrigin-RevId: 338210523
--
7b11c945dbba7a354103c194877eba240f7f0cbc by Derek Mauro <dmauro@google.com>:
Allow pinning to a GoogleTest commit to make the build reproducible
Allow using a cached copy of the commit to avoid depending on GitHub
PiperOrigin-RevId: 338115715
--
8414f496c570a6398744da8324e158b39a2e3d92 by Andy Getzendanner <durandal@google.com>:
Generate a pkg-config file per absl_cc_library.
PiperOrigin-RevId: 337986219
GitOrigin-RevId: d09230db053c544c2dc7fd7d95d1ebe4302071e9
Change-Id: Iae398ab8ad5c0c6833abd01aa5198315f5b6fa99
--
763b4755cc65db94fb1d6c09655f77deee685698 by Evan Brown <ezb@google.com>:
Rollback change getting rid of recursion in clear_and_delete().
PiperOrigin-RevId: 322156175
--
e430ae6970ae2e76357876449878033e3c72e734 by Greg Falcon <gfalcon@google.com>:
fix build on P9
Import of https://github.com/abseil/abseil-cpp/pull/739
PiperOrigin-RevId: 321855200
--
3076c5bf811a950e7f7914023434d4aa9c0fbbb0 by Derek Mauro <dmauro@google.com>:
Check for the existence of CMake policies before using them
Fixes#742
PiperOrigin-RevId: 321798698
GitOrigin-RevId: 763b4755cc65db94fb1d6c09655f77deee685698
Change-Id: I641e42f8bebe236b75f1bf1116a129c2ad9b2571
--
4fc38390e66394e51ef4637ca0778f929017b4c8 by Gennadiy Rozental <rogeeff@google.com>:
Internal Change
PiperOrigin-RevId: 321020681
--
880d1c1cb7590e7265e21afe32edde473ef830d4 by Derek Mauro <dmauro@google.com>:
Decrease number of threads in thread_identity_test to hopefully
prevent test timeouts
PiperOrigin-RevId: 321019403
GitOrigin-RevId: 4fc38390e66394e51ef4637ca0778f929017b4c8
Change-Id: Id8175bae6e490277d663d76fff9c06353b8c7f05
--
b2b94b9f533e4f9ae2a2df9de56ccb3b18f31d0d by Gennadiy Rozental <rogeeff@google.com>:
Internal change
PiperOrigin-RevId: 314366138
--
7a5ac6be82741aec5b327d7b67efd14d69deed6a by Gennadiy Rozental <rogeeff@google.com>:
Introduce Abseil prefixed dynamic annotation macros.
PiperOrigin-RevId: 314228914
--
33e7c605cb1be9bd48bd3590b1eedccd68d3bd1b by Gennadiy Rozental <rogeeff@google.com>:
Fixing missing includes and remove unnecessary ones.
PiperOrigin-RevId: 314217909
--
6a3c5c26bfa13317bf0a880f13d0e4be0b971b76 by Gennadiy Rozental <rogeeff@google.com>:
Import of CCTZ from GitHub.
PiperOrigin-RevId: 314209576
--
f7795aa68020af4a6b4905531ba951e04b88966a by Abseil Team <absl-team@google.com>:
absl::FormatTime() and absl::ParseTime() format specifiers:
- %EZ now accepts 'z' in addition to 'Z' as a synonym for +00:00.
- %ET is introduced, producing 'T' on output, and accepting 'T'
or 't' on input. This is for the RFC3339 date-time separator.
PiperOrigin-RevId: 313945137
--
87c437ce3aab3f59a7546e44a28cd1c8aaa152c3 by Laramie Leavitt <lar@google.com>:
Rollback
PiperOrigin-RevId: 313868206
--
8049b74349486a0026932b86d29c380b195e1cba by Laramie Leavitt <lar@google.com>:
Remove the MockingBitGenBase base class in favor of type-erasure in BitGenRef.
In Abseil random, mocking was split across two different classes,
MockingBitGenBase and MockingBitGen. This split existed because Google Mock is a
test-only library that we don't link into production, so MockingBitGenBase
provided a low-overhead scaffold used to lookup mocks when in test code, but
which is unused in production code.
That has been replaced by type-erasure which looks for a method named
CallImpl with the correct signature.
Weaken the coupling between MockingBitGen, DistributionCaller, and MockOverloadSet.
Rename CallImpl to InvokeMock()
Previously, the implementation of DistributionCaller was also split across different files using explicit instantiation of the DistributionCaller struct and some details in the Mocking classes. Now Distribution caller uses the presence of the InvokeMock() method to choose whether to use the mockable call path or the default call path.
PiperOrigin-RevId: 313848695
--
1741d80e08050e1939605f70ca6ff64809785c85 by Gennadiy Rozental <rogeeff@google.com>:
Introduce public interface to access reflection handle corresponding the flag.
This interface will be the only official way to access flag reflection information from the flag object. The other internal methods will eventually disappear.
PiperOrigin-RevId: 313734006
--
c375bead457de29d9c29595d16c66d3e5125b585 by Abseil Team <absl-team@google.com>:
Improve documentation of absl::c_partial_sort_copy.
This function takes no middle parameter, instead using the size of the result
container to determine the size of the partial sort.
PiperOrigin-RevId: 313656062
--
bbc759d43656b1b996ad558f23c852a9f14129d2 by Gennadiy Rozental <rogeeff@google.com>:
Eliminate dynamic annotation symbols in the library.
PiperOrigin-RevId: 313650817
GitOrigin-RevId: b2b94b9f533e4f9ae2a2df9de56ccb3b18f31d0d
Change-Id: Ic7a11bbcb723f3ff6a7e2f214bff0a92c6f8ab4d
install(DIRECTORY...) creates all directories. If there's is no matching
files, it becomes an empty directory. The three empty directories are
absl/copts, absl/strings/testdata and absl/time/internal/cctz/testdata.
It is a workaround as cmake does not have an option to exclude empty
directories.
Reference: https://gitlab.kitware.com/cmake/cmake/-/issues/19189
--
cb68208c1ae9ca45ce48bf2b7e6cc46592a3b22d by Derek Mauro <dmauro@google.com>:
Update GoogleTest dependency and use it to mark a parameterized test
as possibly unused.
PiperOrigin-RevId: 313643136
--
24f61fe25e943e78f8a1fd014c89516776943170 by Derek Mauro <dmauro@google.com>:
Internal change
PiperOrigin-RevId: 313636155
--
36c453ddf04791f8cf3d14673bacd7bbd98911fd by Gennadiy Rozental <rogeeff@google.com>:
Address sanitizer should not use DYNAMIC_ANNOTATIONS_ENABLED=1
PiperOrigin-RevId: 313635651
--
7a7a3e3888ac8ae366572ea0a2a1c62dc669cec7 by Abseil Team <absl-team@google.com>:
CMake: don't attempt to use googletest unless ABSL_RUN_TESTS==true.
Fixes: https://github.com/abseil/abseil-cpp/issues/690
PiperOrigin-RevId: 313477705
GitOrigin-RevId: cb68208c1ae9ca45ce48bf2b7e6cc46592a3b22d
Change-Id: Ief7b31b53cdf3f79518b767d882960c1636aad23
--
f012012ef78234a6a4585321b67d7b7c92ebc266 by Laramie Leavitt <lar@google.com>:
Slight restructuring of absl/random/internal randen implementation.
Convert round-keys.inc into randen_round_keys.cc file.
Consistently use a 128-bit pointer type for internal method parameters. This allows simpler pointer arithmetic in C++ & permits removal of some constants and casts.
Remove some redundancy in comments & constexpr variables. Specifically, all references to Randen algorithm parameters use RandenTraits; duplication in RandenSlow removed.
PiperOrigin-RevId: 312190313
--
dc8b42e054046741e9ed65335bfdface997c6063 by Abseil Team <absl-team@google.com>:
Internal change.
PiperOrigin-RevId: 312167304
--
f13d248fafaf206492c1362c3574031aea3abaf7 by Matthew Brown <matthewbr@google.com>:
Cleanup StrFormat extensions a little.
PiperOrigin-RevId: 312166336
--
9d9117589667afe2332bb7ad42bc967ca7c54502 by Derek Mauro <dmauro@google.com>:
Internal change
PiperOrigin-RevId: 312105213
--
9a12b9b3aa0e59b8ee6cf9408ed0029045543a9b by Abseil Team <absl-team@google.com>:
Complete IGNORE_TYPE macro renaming.
PiperOrigin-RevId: 311999699
--
64756f20d61021d999bd0d4c15e9ad3857382f57 by Gennadiy Rozental <rogeeff@google.com>:
Switch to fixed bytes specific default value.
This fixes the Abseil Flags for big endian platforms.
PiperOrigin-RevId: 311844448
--
bdbe6b5b29791dbc3816ada1828458b3010ff1e9 by Laramie Leavitt <lar@google.com>:
Change many distribution tests to use pcg_engine as a deterministic source of entropy.
It's reasonable to test that the BitGen itself has good entropy, however when testing the cross product of all random distributions x all the architecture variations x all submitted changes results in a large number of tests. In order to account for these failures while still using good entropy requires that our allowed sigma need to account for all of these independent tests.
Our current sigma values are too restrictive, and we see a lot of failures, so we have to either relax the sigma values or convert some of the statistical tests to use deterministic values.
This changelist does the latter.
PiperOrigin-RevId: 311840096
GitOrigin-RevId: f012012ef78234a6a4585321b67d7b7c92ebc266
Change-Id: Ic84886f38ff30d7d72c126e9b63c9a61eb729a1a