Test for too-old-intel compilers.

This commit is contained in:
Stephen Kelly 2011-08-23 19:49:39 +02:00
parent 42154ec01c
commit 32eff0caec
1 changed files with 12 additions and 1 deletions

View File

@ -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)