|
| 1 | ++++ |
| 2 | +title = "Asbseil Support" |
| 3 | +weight = 530 |
| 4 | +linkTitle = "Asbseil Support" |
| 5 | +description = "The C++ implementation of Protocol Buffers has an explicit dependency on Abseil." |
| 6 | +type = "docs" |
| 7 | ++++ |
| 8 | + |
| 9 | +In [version 22.x](/news/v22#abseil-dep), C++ protobuf |
| 10 | +added an explicit dependency on Abseil. |
| 11 | + |
| 12 | +## Bazel Support {#bazel} |
| 13 | + |
| 14 | +If you are using Bazel, to determine the version of Abseil that your protobuf |
| 15 | +version supports, you can use the `bazel mod` command: |
| 16 | + |
| 17 | +```shell |
| 18 | +$ bazel mod deps abseil-cpp --enable_bzlmod |
| 19 | +<root> (protobuf@30.0-dev) |
| 20 | +└───abseil-cpp@20240722.0 |
| 21 | + ├───bazel_skylib@1.7.1 |
| 22 | + ├───googletest@1.15.2 |
| 23 | + └───platforms@0.0.10 |
| 24 | +``` |
| 25 | + |
| 26 | +`bazel mod graph` produces the full output: |
| 27 | + |
| 28 | +```shell |
| 29 | +$ bazel mod graph --enable_bzlmod |
| 30 | +<root> (protobuf@30.0-dev) |
| 31 | +├───abseil-cpp@20240722.0 |
| 32 | +│ ├───bazel_skylib@1.7.1 (*) |
| 33 | +│ ├───googletest@1.15.2 (*) |
| 34 | +│ └───platforms@0.0.10 (*) |
| 35 | +├───bazel_features@1.18.0 |
| 36 | +│ └───bazel_skylib@1.7.1 (*) |
| 37 | +├───bazel_skylib@1.7.1 |
| 38 | +│ ├───platforms@0.0.10 (*) |
| 39 | +│ └───rules_license@1.0.0 (*) |
| 40 | +├───googletest@1.15.2 |
| 41 | +│ ├───abseil-cpp@20240722.0 (*) |
| 42 | +│ ├───platforms@0.0.10 (*) |
| 43 | +│ └───re2@2024-07-02 |
| 44 | +... |
| 45 | +``` |
| 46 | + |
| 47 | +## CMake Support {#cmake} |
| 48 | + |
| 49 | +Our CMake support is best-effort compared to Bazel. To check for support, try |
| 50 | +the following steps: |
| 51 | + |
| 52 | +1. Run the `cmake .` command. |
| 53 | +2. Open `_deps/absl-src/CMakeLists.txt`. |
| 54 | + |
| 55 | +Look for the following line: |
| 56 | + |
| 57 | +``` |
| 58 | +project(absl LANGUAGES CXX VERSION 20240722) |
| 59 | +set(ABSL_SOVERSION "2407.0.0") |
| 60 | +include(CTest) |
| 61 | +``` |
0 commit comments