summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2011-08-23 17:49:39 (GMT)
committerStephen Kelly <steveire@gmail.com>2011-08-23 17:49:39 (GMT)
commit32eff0caec8fa896fdbb58d259c5cff2614279c3 (patch)
tree35a3711eb31ac9346806910fc97e195c43e23719 /Modules
parent42154ec01cc6250097880c6c13ea5bba88e3a6b0 (diff)
downloadCMake-32eff0caec8fa896fdbb58d259c5cff2614279c3.zip
CMake-32eff0caec8fa896fdbb58d259c5cff2614279c3.tar.gz
CMake-32eff0caec8fa896fdbb58d259c5cff2614279c3.tar.bz2
Test for too-old-intel compilers.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/GenerateExportHeader.cmake13
1 files changed, 12 insertions, 1 deletions
diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake
index 7a4b6d3..1d4c482 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -146,10 +146,21 @@ macro(_test_compiler_hidden_visibility)
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
# the check_cxx_compiler_flag passes
# 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-inlines-hidden COMPILER_HAS_HIDDEN_INLINE_VISIBILITY)
option(USE_COMPILER_HIDDEN_VISIBILITY "Use HIDDEN visibility support if available." ON)