[cmake-developers] Add CXX_STANDARD support for Intel C++ compilers
Brad King
brad.king at kitware.com
Wed Nov 18 15:06:39 EST 2015
On 11/18/2015 02:32 PM, Levi Morrison wrote:
> After some other tweaks I am able to get Intel C++ compiler versions
> 12.1.4 13.0.1, 14.0.0, 14.0.2, 15.0.0, 15.0.2, 15.0.3 to work!
> Both tests found by `ctest -R CompileFeatures -VV` pass.
Great. However, the concern I raised earlier about detecting
C++11 features in C++14 mode has not been addressed. For example:
set(Intel14_CXX11 "__ICC >= 1400 && __INTEL_CXX11_MODE__")
In C++14 mode this check fails so all the conditional features are
detected to not exist. Tests/CompileFeatures/CMakeFiles/CMakeOutput.log
shows:
Detecting CXX [-std=c++1y] compiler features compiled with the following output:
...
Feature record: CXX_FEATURE:0cxx_defaulted_move_initializers
...
Detecting CXX [-std=c++11] compiler features compiled with the following output:
...
Feature record: CXX_FEATURE:1cxx_defaulted_move_initializers
The "0" and "1" are an internal detection code encoding for whether
the feature exists according to the feature test specified. We see
that the C++14 mode does not think the feature exists. This is not
the case for GNU or other compilers.
I'm not sure why this doesn't cause problems in the test, but the
conditions need to be fixed to avoid this problem. __INTEL_CXX11_MODE__
only tells us that we are in *exactly* C++11 mode and so is not
reliable for detecting C++11 features in C++14 mode.
-Brad
More information about the cmake-developers
mailing list