diff options
Diffstat (limited to 'Modules/Compiler/Intel-CXX.cmake')
-rw-r--r-- | Modules/Compiler/Intel-CXX.cmake | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake index 73dd7fa..d01d38d 100644 --- a/Modules/Compiler/Intel-CXX.cmake +++ b/Modules/Compiler/Intel-CXX.cmake @@ -10,19 +10,23 @@ set(CMAKE_DEPFILE_FLAGS_CXX "-MD -MT <OBJECT> -MF <DEPFILE>") if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") set(_std -Qstd) set(_ext c++) + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0) + set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-Qstd=c++14") + # todo: there is no gnu++14 value supported; figure out what to do + set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-Qstd=c++14") + endif() else() set(_std -std) set(_ext gnu++) -endif() - -if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.2) - set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "${_std}=c++14") - # todo: there is no gnu++14 value supported; figure out what to do - set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "${_std}=c++14") -elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.0) - set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "${_std}=c++1y") - # todo: there is no gnu++14 value supported; figure out what to do - set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "${_std}=c++1y") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.2) + set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14") + # todo: there is no gnu++14 value supported; figure out what to do + set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=c++14") + elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.0) + set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++1y") + # todo: there is no gnu++14 value supported; figure out what to do + set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=c++1y") + endif() endif() if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0) @@ -34,8 +38,13 @@ elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1) endif() if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1) - set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "${_std}=c++98") - set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "${_std}=${_ext}98") + if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") + set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "") + set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "") + else() + set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "${_std}=c++98") + set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "${_std}=gnu++98") + endif() endif() if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1) @@ -55,21 +64,18 @@ unset(_std) unset(_ext) macro(cmake_record_cxx_compile_features) - macro(_get_intel_features std_version list) - record_compiler_features(CXX "${std_version}" ${list}) - endmacro() - set(_result 0) - if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC" AND - NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1) - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0) - _get_intel_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) + if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1) + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0 + OR (NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC" AND + NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0)) + _record_compiler_features_cxx(14) endif() if (_result EQUAL 0) - _get_intel_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) + _record_compiler_features_cxx(11) endif() if (_result EQUAL 0) - _get_intel_features(${CMAKE_CXX98_STANDARD_COMPILE_OPTION} CMAKE_CXX98_COMPILE_FEATURES) + _record_compiler_features_cxx(98) endif() endif() endmacro() |