summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-10-11 12:32:37 (GMT)
committerBrad King <brad.king@kitware.com>2019-10-11 12:32:37 (GMT)
commitef5875b5593833ba99bc7a8afd23a1c9cd80cd3e (patch)
tree22a5f55a89a675be69953a26dd5319c3c6692273
parent9150c818b7d2afb868575fcb2e0c9ba62b9d7f85 (diff)
parent3fb146cb1149ecb90404a5276c8db3cb46e00889 (diff)
downloadCMake-ef5875b5593833ba99bc7a8afd23a1c9cd80cd3e.zip
CMake-ef5875b5593833ba99bc7a8afd23a1c9cd80cd3e.tar.gz
CMake-ef5875b5593833ba99bc7a8afd23a1c9cd80cd3e.tar.bz2
Merge branch 'intel-19-compile-features' into release-3.16
Merge-request: !3900
-rw-r--r--Modules/CMakeCXXCompilerId.cpp.in16
-rw-r--r--Tests/CompileFeatures/CMakeLists.txt6
-rw-r--r--Tests/CompileFeatures/default_dialect.cpp12
3 files changed, 30 insertions, 4 deletions
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index 34639b4..a743ce7 100644
--- a/Modules/CMakeCXXCompilerId.cpp.in
+++ b/Modules/CMakeCXXCompilerId.cpp.in
@@ -27,10 +27,20 @@ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
@CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT@
@CMAKE_CXX_COMPILER_ID_ERROR_FOR_TEST@
-#if defined(_MSC_VER) && defined(_MSVC_LANG)
-#define CXX_STD _MSVC_LANG
+#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L
+# if defined(__INTEL_CXX11_MODE__)
+# if defined(__cpp_aggregate_nsdmi)
+# define CXX_STD 201402L
+# else
+# define CXX_STD 201103L
+# endif
+# else
+# define CXX_STD 199711L
+# endif
+#elif defined(_MSC_VER) && defined(_MSVC_LANG)
+# define CXX_STD _MSVC_LANG
#else
-#define CXX_STD __cplusplus
+# define CXX_STD __cplusplus
#endif
const char* info_language_dialect_default = "INFO" ":" "dialect_default["
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt
index 060fb49..ef9198d 100644
--- a/Tests/CompileFeatures/CMakeLists.txt
+++ b/Tests/CompileFeatures/CMakeLists.txt
@@ -130,6 +130,12 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
+ if (CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC"
+ AND CMAKE_CXX_SIMULATE_VERSION VERSION_LESS 19.10)
+ list(REMOVE_ITEM CXX_non_features
+ cxx_relaxed_constexpr
+ )
+ endif()
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0)
if (CMAKE_CXX_COMIPLER_VERSION VERSION_EQUAL 15.0)
list(REMOVE_ITEM CXX_non_features
diff --git a/Tests/CompileFeatures/default_dialect.cpp b/Tests/CompileFeatures/default_dialect.cpp
index 3ee60a6..e6b3ff6 100644
--- a/Tests/CompileFeatures/default_dialect.cpp
+++ b/Tests/CompileFeatures/default_dialect.cpp
@@ -2,7 +2,17 @@
template <long l>
struct Outputter;
-#if defined(_MSC_VER) && defined(_MSVC_LANG)
+#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L
+# if defined(__INTEL_CXX11_MODE__)
+# if defined(__cpp_aggregate_nsdmi)
+# define CXX_STD 201402L
+# else
+# define CXX_STD 201103L
+# endif
+# else
+# define CXX_STD 199711L
+# endif
+#elif defined(_MSC_VER) && defined(_MSVC_LANG)
# define CXX_STD _MSVC_LANG
#else
# define CXX_STD __cplusplus