Commit 3dbec532 authored by Robert Maynard's avatar Robert Maynard

CompileFeatures: Record when compilers gained full CXX14 support

Use the infrastructure added by commit 646fb1a6 (CompileFeatures:
memoize C++ compilers with full language level support, 2019-03-27) to
avoid using a `try_compile` to check for C++14 feature support when the
running compiler is known to have all features.
parent fb325daa
......@@ -29,9 +29,11 @@ if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14")
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++14")
set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++1y")
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++1y")
set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
endif()
set(_clang_version_std17 5.0)
......
......@@ -38,6 +38,10 @@ elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++1y")
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++17")
set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++17")
......
......@@ -40,6 +40,16 @@ else()
set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++17")
endif()
# While full C++14 support was first introduced in Intel 17,
# Intel 18.0.0-4 don't have full support as they broke
# support for cxx_relaxed_constexpr.
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 18.0.4)
set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 17.0.0
AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0.0)
set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.2)
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14")
elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment