Skip to content

Commit f4cc92c

Browse files
tonyliaosscopybara-github
authored andcommitted
Remove stale references to C++14.
The main branch was upgraded to use C++17 after the 29.0 branch cut, in commit fe53593 There are still stale references to C++14 in the code, build chain, and READMEs. This commit cleans up the stale configs and settings. PiperOrigin-RevId: 706000867
1 parent 0a95ae4 commit f4cc92c

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

.github/workflows/test_cpp.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ jobs:
4545
cache_key: Bazel7
4646
image: "us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.1.2-27cf7b86212020d7e552bc13b1e084abb971da75"
4747
targets: "//src/... //third_party/utf8_range/..."
48-
# TODO: remove -Wno-unreachable-code" when dropping C++14
49-
- config: { name: "Bazel7 with Bzlmod", flags: --enable_bzlmod --enable_workspace --per_file_copt=.*/absl/strings/string_view.h@-Wno-unreachable-code --cxxopt="-Wno-self-assign-overloaded" }
48+
- config: { name: "Bazel7 with Bzlmod", flags: --enable_bzlmod --enable_workspace --cxxopt="-Wno-self-assign-overloaded" }
5049
cache_key: Bazel7bzlmod
5150
image: "us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.1.2-27cf7b86212020d7e552bc13b1e084abb971da75"
5251
targets: "//src/... //third_party/utf8_range/..."

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ set(protobuf_LINK_LIBATOMIC false)
186186
if (NOT MSVC)
187187
include(CheckCXXSourceCompiles)
188188
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
189-
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} -std=c++14)
189+
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} -std=c++17)
190190
check_cxx_source_compiles("
191191
#include <atomic>
192192
int main() {

cmake/README.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@ the same actions can be performed using appropriate GUI tools.
1212

1313
## C++ Version
1414

15-
By default, CMake will use whatever C++ version is the system default. Since
16-
protobuf requires C++14 or newer, sometimes you will need to explicitly override
17-
this. For example, the following:
15+
By default, CMake will use whatever C++ version is the system default. Since
16+
protobuf requires C++17 or newer, sometimes you will need to explicitly override
17+
this. For example, the following:
1818

1919
```
20-
cmake . -DCMAKE_CXX_STANDARD=14
20+
cmake . -DCMAKE_CXX_STANDARD=17
2121
cmake --build .
2222
```
2323

24-
will build protobuf using C++14 (see [CXX_STANDARD](https://cmake.org/cmake/help/latest/prop_tgt/CXX_STANDARD.html#prop_tgt:CXX_STANDARD){.external} for all available options).
24+
will build protobuf using C++17 (see
25+
[CXX_STANDARD](https://cmake.org/cmake/help/latest/prop_tgt/CXX_STANDARD.html#prop_tgt:CXX_STANDARD){.external}
26+
for all available options).
2527

2628
# Windows Builds
2729

@@ -118,7 +120,7 @@ For example:
118120
```console
119121
C:\Path\to\build\protobuf> cmake -S. -Bcmake-out \
120122
-DCMAKE_INSTALL_PREFIX=/tmp/protobuf \
121-
-DCMAKE_CXX_STANDARD=14 \
123+
-DCMAKE_CXX_STANDARD=17 \
122124
-DCMAKE_PREFIX_PATH=/tmp/absl # Path to where I installed Abseil
123125
```
124126

0 commit comments

Comments
 (0)