diff --git a/CMakeLists.txt b/CMakeLists.txt index f791390c680..0db6607fdb3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,15 @@ if(NOT CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) option(ABSL_ENABLE_INSTALL "Enable install rule" OFF) else() option(ABSL_ENABLE_INSTALL "Enable install rule" ON) + if(NOT DEFINED CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 14) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + message("CXX standard set to 14.") + endif() +endif() + +if(NOT DEFINED CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD LESS 14) + message(FATAL_ERROR "Abseil requires at least C++14.") endif() set(CMAKE_INSTALL_RPATH "$ORIGIN")