浏览代码

Test for too-old-intel compilers.

Stephen Kelly 14 年之前
父节点
当前提交
32eff0caec
共有 1 个文件被更改,包括 12 次插入1 次删除
  1. 12 1
      Modules/GenerateExportHeader.cmake

+ 12 - 1
Modules/GenerateExportHeader.cmake

@@ -146,10 +146,21 @@ macro(_test_compiler_hidden_visibility)
     endif()
     endif()
   endif()
   endif()
 
 
+  if(CMAKE_CXX_COMPILER_ID MATCHES Intel)
+    exec_program(${CMAKE_CXX_COMPILER} ARGS -V OUTPUT_VARIABLE     _intel_version_info)
+    string (REGEX REPLACE ".*Version ([0-9]+(\\.[0-9]+)+).*" "\\1" _intel_version "${_intel_version_info}")
+
+    if(${_intel_version} VERSION_LESS "12.0")
+      set(_INTEL_TOO_OLD TRUE)
+      message(WARNING "Intel compiler older than 12.0")
+    endif()
+  endif()
+
+
   # Exclude XL here because it misinterprets -fvisibility=hidden even though
   # Exclude XL here because it misinterprets -fvisibility=hidden even though
   # the check_cxx_compiler_flag passes
   # the check_cxx_compiler_flag passes
   # http://www.cdash.org/CDash/testDetails.php?test=109109951&build=1419259
   # http://www.cdash.org/CDash/testDetails.php?test=109109951&build=1419259
-  if (NOT GCC_TOO_OLD AND NOT WIN32 AND NOT CYGWIN AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES XL AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES PGI)
+  if (NOT GCC_TOO_OLD AND NOT _INTEL_TOO_OLD AND NOT WIN32 AND NOT CYGWIN AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES XL AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES PGI)
     check_cxx_compiler_flag(-fvisibility=hidden COMPILER_HAS_HIDDEN_VISIBILITY)
     check_cxx_compiler_flag(-fvisibility=hidden COMPILER_HAS_HIDDEN_VISIBILITY)
     check_cxx_compiler_flag(-fvisibility-inlines-hidden COMPILER_HAS_HIDDEN_INLINE_VISIBILITY)
     check_cxx_compiler_flag(-fvisibility-inlines-hidden COMPILER_HAS_HIDDEN_INLINE_VISIBILITY)
     option(USE_COMPILER_HIDDEN_VISIBILITY "Use HIDDEN visibility support if available." ON)
     option(USE_COMPILER_HIDDEN_VISIBILITY "Use HIDDEN visibility support if available." ON)