summaryrefslogtreecommitdiff
path: root/CMake
diff options
context:
space:
mode:
authorGravatar Derek Mauro <dmauro@google.com>2022-07-06 19:08:47 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2022-07-06 19:09:41 -0700
commit97ab3dcfd6490434202e4ab00b2eaba9449e42a1 (patch)
tree9a4a5008b535d52ed0be0807a1262c5c7c036922 /CMake
parent9edef2349c8c4ace11b4a1b97365cf9c9a293dc8 (diff)
Move Abseil to C++14 minimum
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
Diffstat (limited to 'CMake')
-rw-r--r--CMake/AbseilHelpers.cmake12
-rw-r--r--CMake/README.md4
2 files changed, 8 insertions, 8 deletions
diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake
index 6d03381b..ebe9ddc8 100644
--- a/CMake/AbseilHelpers.cmake
+++ b/CMake/AbseilHelpers.cmake
@@ -258,10 +258,10 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
endif()
if(ABSL_PROPAGATE_CXX_STD)
- # Abseil libraries require C++11 as the current minimum standard.
+ # Abseil libraries require C++14 as the current minimum standard.
# Top-level application CMake projects should ensure a consistent C++
# standard for all compiled sources by setting CMAKE_CXX_STANDARD.
- target_compile_features(${_NAME} PUBLIC cxx_std_11)
+ target_compile_features(${_NAME} PUBLIC cxx_std_14)
else()
# Note: This is legacy (before CMake 3.8) behavior. Setting the
# target-level CXX_STANDARD property to ABSL_CXX_STANDARD (which is
@@ -306,10 +306,10 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
target_compile_definitions(${_NAME} INTERFACE ${ABSL_CC_LIB_DEFINES})
if(ABSL_PROPAGATE_CXX_STD)
- # Abseil libraries require C++11 as the current minimum standard.
+ # Abseil libraries require C++14 as the current minimum standard.
# Top-level application CMake projects should ensure a consistent C++
# standard for all compiled sources by setting CMAKE_CXX_STANDARD.
- target_compile_features(${_NAME} INTERFACE cxx_std_11)
+ target_compile_features(${_NAME} INTERFACE cxx_std_14)
# (INTERFACE libraries can't have the CXX_STANDARD property set, so there
# is no legacy behavior else case).
@@ -418,10 +418,10 @@ function(absl_cc_test)
set_property(TARGET ${_NAME} PROPERTY FOLDER ${ABSL_IDE_FOLDER}/test)
if(ABSL_PROPAGATE_CXX_STD)
- # Abseil libraries require C++11 as the current minimum standard.
+ # Abseil libraries require C++14 as the current minimum standard.
# Top-level application CMake projects should ensure a consistent C++
# standard for all compiled sources by setting CMAKE_CXX_STANDARD.
- target_compile_features(${_NAME} PUBLIC cxx_std_11)
+ target_compile_features(${_NAME} PUBLIC cxx_std_14)
else()
# Note: This is legacy (before CMake 3.8) behavior. Setting the
# target-level CXX_STANDARD property to ABSL_CXX_STANDARD (which is
diff --git a/CMake/README.md b/CMake/README.md
index 8134615e..0be3b926 100644
--- a/CMake/README.md
+++ b/CMake/README.md
@@ -43,8 +43,8 @@ cmake_minimum_required(VERSION 3.8.2)
project(my_app_project)
# Pick the C++ standard to compile with.
-# Abseil currently supports C++11, C++14, and C++17.
-set(CMAKE_CXX_STANDARD 11)
+# Abseil currently supports C++14, C++17, and C++20.
+set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_subdirectory(abseil-cpp)