diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2016-04-15 17:40:30 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-04-28 13:16:35 (GMT) |
commit | 36f32ede8d1a2aa1578a726f687a24dec4cc3f33 (patch) | |
tree | 8258a383b95b406a7a5dd0ab3f8c760c355d33ff /Modules/Compiler/Intel-C-FeatureTests.cmake | |
parent | d028b948721d7a6042b87e238542a11fea78edb0 (diff) | |
download | CMake-36f32ede8d1a2aa1578a726f687a24dec4cc3f33.zip CMake-36f32ede8d1a2aa1578a726f687a24dec4cc3f33.tar.gz CMake-36f32ede8d1a2aa1578a726f687a24dec4cc3f33.tar.bz2 |
Features: Record standards and features for Intel C on UNIX
Record features for Intel C 12.1 and above. Skip this for now on
Windows (where Intel C simulates MSVC).
Diffstat (limited to 'Modules/Compiler/Intel-C-FeatureTests.cmake')
-rw-r--r-- | Modules/Compiler/Intel-C-FeatureTests.cmake | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Modules/Compiler/Intel-C-FeatureTests.cmake b/Modules/Compiler/Intel-C-FeatureTests.cmake new file mode 100644 index 0000000..34175c8 --- /dev/null +++ b/Modules/Compiler/Intel-C-FeatureTests.cmake @@ -0,0 +1,23 @@ +# References: +# - https://software.intel.com/en-us/articles/iso-iec-standards-language-conformance-for-intel-c-compiler +# - 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") + +#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_oldestSupported "__INTEL_COMPILER >= 1110") +set(Intel_C99 "${_cmake_oldestSupported} && ${DETECT_C99}") +set(_cmake_feature_test_c_restrict "${Intel_C99}") +set(_cmake_feature_test_c_variadic_macros "${Intel_C99}") +set(_cmake_feature_test_c_function_prototypes "${_cmake_oldestSupported}") +unset(Intel_C99) + +unset(DETECT_C99) |