From 97ab3dcfd6490434202e4ab00b2eaba9449e42a1 Mon Sep 17 00:00:00 2001 From: Derek Mauro Date: Wed, 6 Jul 2022 19:08:47 -0700 Subject: 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 --- CMake/AbseilHelpers.cmake | 12 ++++++------ CMake/README.md | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'CMake') 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) -- cgit v1.2.3