summaryrefslogtreecommitdiffstats
path: root/Modules/GenerateExportHeader.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/GenerateExportHeader.cmake')
-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)