Skip to content

Commit aa85455

Browse files
authored
cleanup!: require C++ >= 14 (#9339)
Starting on the next release, we will require C++ >= 14. I also updated the minimum GCC and Clang versions, to reflect what we actually support and test with.
1 parent 4c67563 commit aa85455

365 files changed

Lines changed: 1111 additions & 634 deletions

File tree

Some content is hidden

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

.bazelrc

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,19 @@
2020
# [1]: https://github.com/bazelbuild/bazel/issues/4341
2121
build --copt=-DGRPC_BAZEL_BUILD
2222

23-
# Do not create the convenience links, they are inconvenient when the build runs
24-
# inside a docker image.
25-
build --experimental_convenience_symlinks=ignore
26-
2723
# Use host-OS-specific config lines from bazelrc files.
2824
build --enable_platform_specific_config=true
2925

26+
# The project requires C++ >= 14. By default Bazel adds `-std=c++0x` which
27+
# disables C++14 features, even if the compilers defaults to C++ >= 14
28+
build:linux --cxxopt=-std=c++14
29+
build:macos --cxxopt=-std=c++14
30+
31+
# Do not create the convenience links. They are inconvenient when the build
32+
# runs inside a docker image or if one builds a quickstart and then builds
33+
# the project separately.
34+
build --experimental_convenience_symlinks=ignore
35+
3036
# Clang Sanitizers, use with (for example):
3137
#
3238
# --client_env=CXX=clang++ --client_env=CC=clang --config asan

CHANGELOG.md

Lines changed: 18 additions & 13 deletions

CMakeLists.txt

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,42 +25,32 @@ if (NOT (CMAKE_VERSION VERSION_LESS 3.15))
2525
endif ()
2626
project(
2727
google-cloud-cpp
28-
VERSION 1.43.0
28+
VERSION 2.0.0
2929
LANGUAGES CXX)
3030

3131
if (APPLE AND NOT DEFINED CMAKE_CXX_STANDARD)
32-
# AppleClang defaults to C++98, so we bump it to C++11.
32+
# AppleClang defaults to C++98, so we bump it to C++14.
3333
message(
3434
WARNING
35-
"CMAKE_CXX_STANDARD was undefined, defaulting to C++11."
35+
"CMAKE_CXX_STANDARD was undefined, defaulting to C++14."
3636
"To select the desired standard use something like the following:"
3737
"\n"
3838
" cmake -DCMAKE_CXX_STANDARD=17 ..."
3939
"\n"
4040
"For more details, see "
4141
"https://cmake.org/cmake/help/latest/variable/CMAKE_CXX_STANDARD.html"
4242
)
43-
set(CMAKE_CXX_STANDARD 11)
43+
set(CMAKE_CXX_STANDARD 14)
4444
endif ()
4545

4646
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
47-
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
48-
message(
49-
FATAL_ERROR
50-
"GCC version must be at least 5.0. Older versions either lack"
51-
" C++11 support or have bugs that prevent us from using them.")
52-
elseif (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.3)
47+
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.3)
5348
message(
5449
WARNING "The `google-cloud-cpp` library is tested with GCC >= 6.3."
5550
" We will consider patches for older versions.")
5651
endif ()
5752
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
58-
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.8)
59-
message(
60-
FATAL_ERROR
61-
"Clang version must be at least 3.8. Older versions either lack"
62-
" C++11 support or have bugs that prevent us from using them.")
63-
elseif (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
53+
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
6454
message(
6555
WARNING
6656
"The `google-cloud-cpp` library is tested with Clang >= 6.0."

README.md

Lines changed: 1 addition & 1 deletion
-5 Bytes
Binary file not shown.
Binary file not shown.
-29 Bytes
Binary file not shown.
7 Bytes
Binary file not shown.
-93 Bytes
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)