From 32eff0caec8fa896fdbb58d259c5cff2614279c3 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 23 Aug 2011 19:49:39 +0200 Subject: Test for too-old-intel compilers. --- Modules/GenerateExportHeader.cmake | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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) -- cgit v0.12