This is an automated email from the ASF dual-hosted git repository.

granthenke pushed a commit to branch apple-m1
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 0c070261f608ebf1f945509d701aeb744868bb0a
Author: Grant Henke <[email protected]>
AuthorDate: Wed Nov 25 17:04:37 2020 -0600

    [build] Support and require C++14
    
    As a smaller preliminary step to C++17, this patch adjust the build to start
    supporting and requiring C++14 (therefore GCC 5+). A follow on patch
    will take the next step to C++17 and update the documentation to drop
    deprecated OS versions and GCC versions.
    
    Change-Id: If13baf4fb1e243eb8a46832c67fe0409f8295799
---
 CMakeLists.txt | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index aeccb9a..3350953 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -311,22 +311,12 @@ if ("${COMPILER_FAMILY}" STREQUAL "clang")
     message("Running without a controlling terminal or in a dumb terminal")
   endif()
 elseif("${COMPILER_FAMILY}" STREQUAL "gcc")
-  # Disallow GCC < 4.8, since it doesn't support the C++11 standard
-  # well enough for us.
-  if ("${COMPILER_VERSION}" VERSION_LESS "4.8")
-    message(FATAL_ERROR "GCC <4.8 not supported. Consider using "
+  # Disallow GCC < 5.0, since it doesn't support the C++14 standard
+  # well enough for us. https://en.cppreference.com/w/cpp/compiler_support
+  if ("${COMPILER_VERSION}" VERSION_LESS "5.0")
+    message(FATAL_ERROR "GCC < 5.0 not supported. Consider using "
         "thirdparty/clang-toolchain/ to build on older hosts.")
   endif()
-
-  # GCC 4.8's tree vectorizer has a bug which causes hard-to-debug incorrect
-  # code. Disable this option on release builds, where it would otherwise
-  # be enabled by -O3.
-  if ("${COMPILER_VERSION}" MATCHES "^4.8" AND
-      "${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
-    message("Running release build on gcc 4.8. The tree-vectorize optimization 
"
-      "in this version of gcc is known to be buggy. Disabling it.")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-tree-vectorize")
-  endif()
 endif()
 
 # Sanity check linking option.
@@ -370,7 +360,7 @@ endif()
 
 # For any C code, use the same flags.
 set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS}")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
 
 # Enable the Clang undefined behavior (UB) sanitizer.
 if (${KUDU_USE_UBSAN})

Reply via email to