From 967dcf36d07ba9b7e40383834906fe1d657456b3 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 27 Oct 2016 13:11:10 -0400 Subject: [PATCH 1/4] Intel: Remove incorrect C++98 standard compiler flag on Windows The change in commit 05e05cd2 (Intel: Fix compiler C++98 standard flag on Windows, 2016-10-26) was wrong. The Intel C++ Compiler for Windows does not support either `-Qstd=c++98` or `-Qstd=gnu++98`. Simply remove both flags for this compiler and use no options at all to achieve this mode. Issue: #16384 --- Modules/Compiler/Intel-CXX.cmake | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake index 29e02d3f4a..63081cce45 100644 --- a/Modules/Compiler/Intel-CXX.cmake +++ b/Modules/Compiler/Intel-CXX.cmake @@ -35,11 +35,12 @@ endif() if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1) if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") - set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "${_std}=gnu++98") + 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() - set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "${_std}=${_ext}98") endif() if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1) @@ -67,13 +68,13 @@ macro(cmake_record_cxx_compile_features) 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) + _get_intel_features("${CMAKE_CXX14_STANDARD_COMPILE_OPTION}" CMAKE_CXX14_COMPILE_FEATURES) endif() if (_result EQUAL 0) - _get_intel_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) + _get_intel_features("${CMAKE_CXX11_STANDARD_COMPILE_OPTION}" CMAKE_CXX11_COMPILE_FEATURES) endif() if (_result EQUAL 0) - _get_intel_features(${CMAKE_CXX98_STANDARD_COMPILE_OPTION} CMAKE_CXX98_COMPILE_FEATURES) + _get_intel_features("${CMAKE_CXX98_STANDARD_COMPILE_OPTION}" CMAKE_CXX98_COMPILE_FEATURES) endif() endif() endmacro() From d34ac22fec975a9f5b6b6b37134e1722ffa06025 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 26 Oct 2016 13:46:11 -0400 Subject: [PATCH 2/4] Features: Unset Intel CXX feature temporaries --- Modules/Compiler/Intel-CXX-FeatureTests.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Modules/Compiler/Intel-CXX-FeatureTests.cmake b/Modules/Compiler/Intel-CXX-FeatureTests.cmake index 57a05c8921..c8db99ef69 100644 --- a/Modules/Compiler/Intel-CXX-FeatureTests.cmake +++ b/Modules/Compiler/Intel-CXX-FeatureTests.cmake @@ -19,6 +19,7 @@ set(DETECT_CXX11 "((__cplusplus >= 201103L) || defined(__INTEL_CXX11_MODE__) || #we look for the existence of __GXX_EXPERIMENTAL_CXX0X__ but not __INTEL_CXX11_MODE__ set(DETECT_BUGGY_ICC15 "((__INTEL_COMPILER == 1500) && (__INTEL_COMPILER_UPDATE == 1))") set(DETECT_CXX14 "((__cplusplus >= 201300L) || ((__cplusplus == 201103L) && !defined(__INTEL_CXX11_MODE__)) || ((${DETECT_BUGGY_ICC15}) && defined(__GXX_EXPERIMENTAL_CXX0X__) && !defined(__INTEL_CXX11_MODE__) ) )") +unset(DETECT_BUGGY_ICC15) set(Intel16_CXX14 "__INTEL_COMPILER >= 1600 && ${DETECT_CXX14}") set(_cmake_feature_test_cxx_aggregate_default_initializers "${Intel16_CXX14}") @@ -30,12 +31,14 @@ set(_cmake_feature_test_cxx_digit_separators "${Intel16_CXX14}") # https://software.intel.com/en-us/forums/intel-c-compiler/topic/600514 # It also appears to fail with an internal compiler error on Intel 16. #set(_cmake_feature_test_cxx_generalized_initializers "${Intel16_CXX14}") +unset(Intel16_CXX14) set(Intel15_CXX14 "__INTEL_COMPILER >= 1500 && ${DETECT_CXX14}") set(_cmake_feature_test_cxx_decltype_auto "${Intel15_CXX14}") set(_cmake_feature_test_cxx_lambda_init_captures "${Intel15_CXX14}") set(_cmake_feature_test_cxx_attribute_deprecated "${Intel15_CXX14}") set(_cmake_feature_test_cxx_return_type_deduction "${Intel15_CXX14}") +unset(Intel15_CXX14) set(Intel15_CXX11 "__INTEL_COMPILER >= 1500 && ${DETECT_CXX11}") set(_cmake_feature_test_cxx_alignas "${Intel15_CXX11}") @@ -43,6 +46,7 @@ set(_cmake_feature_test_cxx_alignof "${Intel15_CXX11}") set(_cmake_feature_test_cxx_inheriting_constructors "${Intel15_CXX11}") set(_cmake_feature_test_cxx_user_literals "${Intel15_CXX11}") set(_cmake_feature_test_cxx_thread_local "${Intel15_CXX11}") +unset(Intel15_CXX11) set(Intel14_CXX11 "${DETECT_CXX11} && (__INTEL_COMPILER > 1400 || (__INTEL_COMPILER == 1400 && __INTEL_COMPILER_UPDATE >= 2))") # Documented as 12.0+ but in testing it only works on 14.0.2+ @@ -64,12 +68,14 @@ set(_cmake_feature_test_cxx_override "${Intel14_CXX11}") set(_cmake_feature_test_cxx_final "${Intel14_CXX11}") set(_cmake_feature_test_cxx_noexcept "${Intel14_CXX11}") set(_cmake_feature_test_cxx_defaulted_move_initializers "${Intel14_CXX11}") +unset(Intel14_CXX11) set(Intel13_CXX11 "__INTEL_COMPILER >= 1300 && ${DETECT_CXX11}") set(_cmake_feature_test_cxx_explicit_conversions "${Intel13_CXX11}") set(_cmake_feature_test_cxx_range_for "${Intel13_CXX11}") # Cannot find Intel documentation for N2640: cxx_uniform_initialization set(_cmake_feature_test_cxx_uniform_initialization "${Intel13_CXX11}") +unset(Intel13_CXX11) set(Intel121_CXX11 "${_cmake_oldestSupported} && ${DETECT_CXX11}") set(_cmake_feature_test_cxx_variadic_templates "${Intel121_CXX11}") @@ -94,3 +100,7 @@ set(_cmake_feature_test_cxx_variadic_macros "${Intel121_CXX11}") set(_cmake_feature_test_cxx_long_long_type "${Intel121_CXX11}") set(_cmake_feature_test_cxx_func_identifier "${Intel121_CXX11}") set(_cmake_feature_test_cxx_template_template_parameters "${Intel121_CXX11}") +unset(Intel121_CXX11) + +unset(DETECT_CXX11) +unset(DETECT_CXX14) From a5a3642f9292bb697176aaf1077fc98302f286b7 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 26 Oct 2016 13:47:00 -0400 Subject: [PATCH 3/4] Features: Port Intel CXX features to test macros where possible The Intel 16 and 17 compilers define feature test macros of the form `__cpp_`. Use them where possible to detect corresponding features. --- Modules/Compiler/Intel-CXX-FeatureTests.cmake | 49 ++++++++++++------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/Modules/Compiler/Intel-CXX-FeatureTests.cmake b/Modules/Compiler/Intel-CXX-FeatureTests.cmake index c8db99ef69..71641ffd28 100644 --- a/Modules/Compiler/Intel-CXX-FeatureTests.cmake +++ b/Modules/Compiler/Intel-CXX-FeatureTests.cmake @@ -3,6 +3,15 @@ # - https://software.intel.com/en-us/articles/c14-features-supported-by-intel-c-compiler # - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0096r3.html +# Notes: +# [1] Some Intel versions define some feature macros under -std=gnu++98 +# that do not work in that mode (or work with warnings): +# - __cpp_attributes 200809 +# - __cpp_init_captures 201304 +# - __cpp_lambdas 200907 +# - __cpp_rvalue_references 200610 +# - __cpp_variadic_templates 200704 + # FIXME: Intel C++ feature detection works only when simulating the GNU compiler. # When simulating MSVC, Intel always sets __cplusplus to 199711L. if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") @@ -24,27 +33,29 @@ unset(DETECT_BUGGY_ICC15) set(Intel16_CXX14 "__INTEL_COMPILER >= 1600 && ${DETECT_CXX14}") set(_cmake_feature_test_cxx_aggregate_default_initializers "${Intel16_CXX14}") set(_cmake_feature_test_cxx_contextual_conversions "${Intel16_CXX14}") -set(_cmake_feature_test_cxx_generic_lambdas "${Intel16_CXX14}") +set(_cmake_feature_test_cxx_generic_lambdas "__cpp_generic_lambdas >= 201304") set(_cmake_feature_test_cxx_digit_separators "${Intel16_CXX14}") # This test is supposed to work in Intel 14 but the compiler has a bug # in versions 14 and 15:: # https://software.intel.com/en-us/forums/intel-c-compiler/topic/600514 -# It also appears to fail with an internal compiler error on Intel 16. +# It also appears to fail with an internal compiler error on Intel 16 and 17. #set(_cmake_feature_test_cxx_generalized_initializers "${Intel16_CXX14}") unset(Intel16_CXX14) -set(Intel15_CXX14 "__INTEL_COMPILER >= 1500 && ${DETECT_CXX14}") -set(_cmake_feature_test_cxx_decltype_auto "${Intel15_CXX14}") -set(_cmake_feature_test_cxx_lambda_init_captures "${Intel15_CXX14}") +set(Intel15 "__INTEL_COMPILER >= 1500") +set(Intel15_CXX14 "${Intel15} && ${DETECT_CXX14}") +set(_cmake_feature_test_cxx_decltype_auto "__cpp_decltype_auto >= 201304 || ${Intel15_CXX14}") +set(_cmake_feature_test_cxx_lambda_init_captures "(__cpp_init_captures >= 201304 || ${Intel15}) && ${DETECT_CXX14}") # [1] set(_cmake_feature_test_cxx_attribute_deprecated "${Intel15_CXX14}") -set(_cmake_feature_test_cxx_return_type_deduction "${Intel15_CXX14}") +set(_cmake_feature_test_cxx_return_type_deduction "__cpp_return_type_deduction >= 201304 || ${Intel15_CXX14}") unset(Intel15_CXX14) +unset(Intel15) set(Intel15_CXX11 "__INTEL_COMPILER >= 1500 && ${DETECT_CXX11}") set(_cmake_feature_test_cxx_alignas "${Intel15_CXX11}") set(_cmake_feature_test_cxx_alignof "${Intel15_CXX11}") set(_cmake_feature_test_cxx_inheriting_constructors "${Intel15_CXX11}") -set(_cmake_feature_test_cxx_user_literals "${Intel15_CXX11}") +set(_cmake_feature_test_cxx_user_literals "__cpp_user_defined_literals >= 200809 || ${Intel15_CXX11}") set(_cmake_feature_test_cxx_thread_local "${Intel15_CXX11}") unset(Intel15_CXX11) @@ -54,12 +65,12 @@ set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${Intel14_CXX11}") set(Intel14_CXX11 "__INTEL_COMPILER >= 1400 && ${DETECT_CXX11}") set(_cmake_feature_test_cxx_delegating_constructors "${Intel14_CXX11}") -set(_cmake_feature_test_cxx_constexpr "${Intel14_CXX11}") +set(_cmake_feature_test_cxx_constexpr "__cpp_constexpr >= 200704 || ${Intel14_CXX11}") set(_cmake_feature_test_cxx_sizeof_member "${Intel14_CXX11}") set(_cmake_feature_test_cxx_strong_enums "${Intel14_CXX11}") set(_cmake_feature_test_cxx_reference_qualified_functions "${Intel14_CXX11}") -set(_cmake_feature_test_cxx_raw_string_literals "${Intel14_CXX11}") -set(_cmake_feature_test_cxx_unicode_literals "${Intel14_CXX11}") +set(_cmake_feature_test_cxx_raw_string_literals "__cpp_raw_strings >= 200710 || ${Intel14_CXX11}") +set(_cmake_feature_test_cxx_unicode_literals "__cpp_unicode_literals >= 200710 || ${Intel14_CXX11}") set(_cmake_feature_test_cxx_inline_namespaces "${Intel14_CXX11}") set(_cmake_feature_test_cxx_unrestricted_unions "${Intel14_CXX11}") set(_cmake_feature_test_cxx_nonstatic_member_init "${Intel14_CXX11}") @@ -77,22 +88,23 @@ set(_cmake_feature_test_cxx_range_for "${Intel13_CXX11}") set(_cmake_feature_test_cxx_uniform_initialization "${Intel13_CXX11}") unset(Intel13_CXX11) -set(Intel121_CXX11 "${_cmake_oldestSupported} && ${DETECT_CXX11}") -set(_cmake_feature_test_cxx_variadic_templates "${Intel121_CXX11}") +set(Intel121 "${_cmake_oldestSupported}") +set(Intel121_CXX11 "${Intel121} && ${DETECT_CXX11}") +set(_cmake_feature_test_cxx_variadic_templates "(__cpp_variadic_templates >= 200704 || ${Intel121}) && ${DETECT_CXX11}") # [1] set(_cmake_feature_test_cxx_alias_templates "${Intel121_CXX11}") set(_cmake_feature_test_cxx_nullptr "${Intel121_CXX11}") set(_cmake_feature_test_cxx_trailing_return_types "${Intel121_CXX11}") -set(_cmake_feature_test_cxx_attributes "${Intel121_CXX11}") +set(_cmake_feature_test_cxx_attributes "__cpp_attributes >= 200809 || ${Intel121}") set(_cmake_feature_test_cxx_default_function_template_args "${Intel121_CXX11}") set(_cmake_feature_test_cxx_extended_friend_declarations "${Intel121_CXX11}") -set(_cmake_feature_test_cxx_rvalue_references "${Intel121_CXX11}") -set(_cmake_feature_test_cxx_decltype "${Intel121_CXX11}") +set(_cmake_feature_test_cxx_rvalue_references "(__cpp_rvalue_references >= 200610 || ${Intel121}) && ${DETECT_CXX11}") # [1] +set(_cmake_feature_test_cxx_decltype "__cpp_decltype >= 200707 || ${Intel121_CXX11}") set(_cmake_feature_test_cxx_defaulted_functions "${Intel121_CXX11}") set(_cmake_feature_test_cxx_deleted_functions "${Intel121_CXX11}") set(_cmake_feature_test_cxx_local_type_template_args "${Intel121_CXX11}") -set(_cmake_feature_test_cxx_lambdas "${Intel121_CXX11}") -set(_cmake_feature_test_cxx_binary_literals "${Intel121_CXX11}") -set(_cmake_feature_test_cxx_static_assert "${Intel121_CXX11}") +set(_cmake_feature_test_cxx_lambdas "(__cpp_lambdas >= 200907 || ${Intel121}) && ${DETECT_CXX11}") # [1] +set(_cmake_feature_test_cxx_binary_literals "__cpp_binary_literals >= 201304 || ${Intel121}") +set(_cmake_feature_test_cxx_static_assert "(__cpp_static_assert >= 200410 || ${Intel121}) && ${DETECT_CXX11}") set(_cmake_feature_test_cxx_right_angle_brackets "${Intel121_CXX11}") set(_cmake_feature_test_cxx_auto_type "${Intel121_CXX11}") set(_cmake_feature_test_cxx_extern_templates "${Intel121_CXX11}") @@ -101,6 +113,7 @@ set(_cmake_feature_test_cxx_long_long_type "${Intel121_CXX11}") set(_cmake_feature_test_cxx_func_identifier "${Intel121_CXX11}") set(_cmake_feature_test_cxx_template_template_parameters "${Intel121_CXX11}") unset(Intel121_CXX11) +unset(Intel121) unset(DETECT_CXX11) unset(DETECT_CXX14) From 369d580937b49c1c5672ba3512c2a736581d545c Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 26 Oct 2016 15:02:35 -0400 Subject: [PATCH 4/4] Features: Record features for Intel Compiler on Windows Since this compiler always defines `__cplusplus` to `1` we need to use `_MSC_VER`, `__INTEL_CXX11_MODE__`, and the feature test macro named `__cpp_aggregate_nsdmi` to detect C++11 and C++14 modes. With no `-Qstd=` flag this compiler defaults to C++98 plus a subset of C++11/C++14 features needed to be compatible with MSVC. We pretend it is plain C++98 and add a `-Qstd=` flag whenever needed for C++11 or above features even if they would happen to be available in MSVC-mode. Closes: #16384 --- Help/manual/cmake-compile-features.7.rst | 2 +- Help/release/dev/intel-compile-features-windows.rst | 6 ++++++ Modules/Compiler/Intel-C-FeatureTests.cmake | 9 +++------ Modules/Compiler/Intel-C.cmake | 3 +-- Modules/Compiler/Intel-CXX-FeatureTests.cmake | 10 ++-------- Modules/Compiler/Intel-CXX.cmake | 3 +-- 6 files changed, 14 insertions(+), 19 deletions(-) create mode 100644 Help/release/dev/intel-compile-features-windows.rst diff --git a/Help/manual/cmake-compile-features.7.rst b/Help/manual/cmake-compile-features.7.rst index 7289e6165f..9862d4a34f 100644 --- a/Help/manual/cmake-compile-features.7.rst +++ b/Help/manual/cmake-compile-features.7.rst @@ -309,4 +309,4 @@ versions specified for each: * ``GNU``: GNU compiler versions 4.4 through 5.0. * ``MSVC``: Microsoft Visual Studio versions 2010 through 2015. * ``SunPro``: Oracle SolarisStudio version 12.4. -* ``Intel``: Intel compiler versions 12.1 through 16.0 on UNIX platforms. +* ``Intel``: Intel compiler versions 12.1 through 17.0. diff --git a/Help/release/dev/intel-compile-features-windows.rst b/Help/release/dev/intel-compile-features-windows.rst new file mode 100644 index 0000000000..6a2cdfe35c --- /dev/null +++ b/Help/release/dev/intel-compile-features-windows.rst @@ -0,0 +1,6 @@ +intel-compile-features-windows +------------------------------ + +* The :manual:`Compile Features ` functionality + is now aware of features supported by Intel C++ compilers versions 12.1 + through 17.0 on UNIX and Windows platforms. diff --git a/Modules/Compiler/Intel-C-FeatureTests.cmake b/Modules/Compiler/Intel-C-FeatureTests.cmake index 34175c8751..5d09767b5a 100644 --- a/Modules/Compiler/Intel-C-FeatureTests.cmake +++ b/Modules/Compiler/Intel-C-FeatureTests.cmake @@ -3,15 +3,11 @@ # - https://software.intel.com/en-us/articles/c99-support-in-intel-c-compiler # - https://software.intel.com/en-us/articles/c11-support-in-intel-c-compiler -# FIXME: Intel C feature detection works only when simulating the GNU compiler. -if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC") - return() -endif() - set(DETECT_C99 "defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L") +set(DETECT_C11 "defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L") #static assert is only around in version 1500 update 2 and above -set(_cmake_feature_test_c_static_assert "(__INTEL_COMPILER > 1500 || (__INTEL_COMPILER == 1500 && __INTEL_COMPILER_UPDATE > 1) ) && ${DETECT_C99}") +set(_cmake_feature_test_c_static_assert "(__INTEL_COMPILER > 1500 || (__INTEL_COMPILER == 1500 && __INTEL_COMPILER_UPDATE > 1) ) && (${DETECT_C11} || ${DETECT_C99} && !defined(_MSC_VER))") set(_cmake_oldestSupported "__INTEL_COMPILER >= 1110") set(Intel_C99 "${_cmake_oldestSupported} && ${DETECT_C99}") @@ -21,3 +17,4 @@ set(_cmake_feature_test_c_function_prototypes "${_cmake_oldestSupported}") unset(Intel_C99) unset(DETECT_C99) +unset(DETECT_C11) diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake index 61adf40d80..581585764c 100644 --- a/Modules/Compiler/Intel-C.cmake +++ b/Modules/Compiler/Intel-C.cmake @@ -52,8 +52,7 @@ macro(cmake_record_c_compile_features) endmacro() set(_result 0) - if (NOT "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC" AND - NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.1) + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.1) if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 15.0.0) _get_intel_c_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) endif() diff --git a/Modules/Compiler/Intel-CXX-FeatureTests.cmake b/Modules/Compiler/Intel-CXX-FeatureTests.cmake index 71641ffd28..5b74fabbe2 100644 --- a/Modules/Compiler/Intel-CXX-FeatureTests.cmake +++ b/Modules/Compiler/Intel-CXX-FeatureTests.cmake @@ -12,12 +12,6 @@ # - __cpp_rvalue_references 200610 # - __cpp_variadic_templates 200704 -# FIXME: Intel C++ feature detection works only when simulating the GNU compiler. -# When simulating MSVC, Intel always sets __cplusplus to 199711L. -if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") - return() -endif() - set(_cmake_feature_test_cxx_variable_templates "__cpp_variable_templates >= 201304") set(_cmake_feature_test_cxx_relaxed_constexpr "__cpp_constexpr >= 201304") @@ -27,7 +21,7 @@ set(DETECT_CXX11 "((__cplusplus >= 201103L) || defined(__INTEL_CXX11_MODE__) || #if you are compiling as 98/11/14. So to properly detect C++14 with this version #we look for the existence of __GXX_EXPERIMENTAL_CXX0X__ but not __INTEL_CXX11_MODE__ set(DETECT_BUGGY_ICC15 "((__INTEL_COMPILER == 1500) && (__INTEL_COMPILER_UPDATE == 1))") -set(DETECT_CXX14 "((__cplusplus >= 201300L) || ((__cplusplus == 201103L) && !defined(__INTEL_CXX11_MODE__)) || ((${DETECT_BUGGY_ICC15}) && defined(__GXX_EXPERIMENTAL_CXX0X__) && !defined(__INTEL_CXX11_MODE__) ) )") +set(DETECT_CXX14 "((__cplusplus >= 201300L) || ((__cplusplus == 201103L) && !defined(__INTEL_CXX11_MODE__)) || ((${DETECT_BUGGY_ICC15}) && defined(__GXX_EXPERIMENTAL_CXX0X__) && !defined(__INTEL_CXX11_MODE__) ) || (defined(_MSC_VER) && defined(__INTEL_CXX11_MODE__) && defined(__cpp_aggregate_nsdmi)) )") unset(DETECT_BUGGY_ICC15) set(Intel16_CXX14 "__INTEL_COMPILER >= 1600 && ${DETECT_CXX14}") @@ -61,7 +55,7 @@ unset(Intel15_CXX11) set(Intel14_CXX11 "${DETECT_CXX11} && (__INTEL_COMPILER > 1400 || (__INTEL_COMPILER == 1400 && __INTEL_COMPILER_UPDATE >= 2))") # Documented as 12.0+ but in testing it only works on 14.0.2+ -set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${Intel14_CXX11}") +set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${Intel14_CXX11} && !defined(_MSC_VER)") set(Intel14_CXX11 "__INTEL_COMPILER >= 1400 && ${DETECT_CXX11}") set(_cmake_feature_test_cxx_delegating_constructors "${Intel14_CXX11}") diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake index 63081cce45..b6bc2ee25e 100644 --- a/Modules/Compiler/Intel-CXX.cmake +++ b/Modules/Compiler/Intel-CXX.cmake @@ -65,8 +65,7 @@ macro(cmake_record_cxx_compile_features) 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 12.1) if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0) _get_intel_features("${CMAKE_CXX14_STANDARD_COMPILE_OPTION}" CMAKE_CXX14_COMPILE_FEATURES) endif()