diff options
author | Brad King <brad.king@kitware.com> | 2016-11-10 20:34:39 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-11-10 20:37:05 (GMT) |
commit | 5e428389615da64208c40be256a30f8c9e988523 (patch) | |
tree | 80eeecd510da95db45ff23ea551d4ff09f19adf7 /Modules/Compiler | |
parent | 1f8480312e41b281eccad13a4afcb7c1ef49f22a (diff) | |
download | CMake-5e428389615da64208c40be256a30f8c9e988523.zip CMake-5e428389615da64208c40be256a30f8c9e988523.tar.gz CMake-5e428389615da64208c40be256a30f8c9e988523.tar.bz2 |
Features: Detect Intel C++14 mode more reliably
The `__cplusplus` macro is not defined to the language level reliably.
When simulating MSVC it is always set to `1`. When simulating GCC it is
set to the lower value of the current language level and the maximum
level supported by the simulated version of GCC (from observation).
For MSVC we already used a combination of `__INTEL_CXX11_MODE__` and
`__cpp_aggregate_nsdmi` to detect C++14 mode. Extend this for general
use by removing the condition on `_MSC_VER`.
Diffstat (limited to 'Modules/Compiler')
-rw-r--r-- | Modules/Compiler/Intel-CXX-FeatureTests.cmake | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/Compiler/Intel-CXX-FeatureTests.cmake b/Modules/Compiler/Intel-CXX-FeatureTests.cmake index d1a3433..05c4189 100644 --- a/Modules/Compiler/Intel-CXX-FeatureTests.cmake +++ b/Modules/Compiler/Intel-CXX-FeatureTests.cmake @@ -21,7 +21,7 @@ set(DETECT_CXX11 "((__cplusplus >= 201103L) || defined(__INTEL_CXX11_MODE__) || #if you are compiling as 98/11/14. So to properly detect C++14 with this version #we look for the existence of __GXX_EXPERIMENTAL_CXX0X__ but not __INTEL_CXX11_MODE__ set(DETECT_BUGGY_ICC15 "((__INTEL_COMPILER == 1500) && (__INTEL_COMPILER_UPDATE == 1))") -set(DETECT_CXX14 "((__cplusplus >= 201300L) || ((__cplusplus == 201103L) && !defined(__INTEL_CXX11_MODE__)) || ((${DETECT_BUGGY_ICC15}) && defined(__GXX_EXPERIMENTAL_CXX0X__) && !defined(__INTEL_CXX11_MODE__) ) || (defined(_MSC_VER) && defined(__INTEL_CXX11_MODE__) && defined(__cpp_aggregate_nsdmi)) )") +set(DETECT_CXX14 "((__cplusplus >= 201300L) || ((__cplusplus == 201103L) && !defined(__INTEL_CXX11_MODE__)) || ((${DETECT_BUGGY_ICC15}) && defined(__GXX_EXPERIMENTAL_CXX0X__) && !defined(__INTEL_CXX11_MODE__) ) || (defined(__INTEL_CXX11_MODE__) && defined(__cpp_aggregate_nsdmi)) )") unset(DETECT_BUGGY_ICC15) set(Intel16_CXX14 "__INTEL_COMPILER >= 1600 && ${DETECT_CXX14}") |