The purpose of that test is to cover the case where the genex
reports '1', and the feature is chosen to be present on all/most
supported compilers. GNU 4.4 does not support cxx_nullptr.
The unit test for this fails with GNU 4.6:
Building CXX object CMakeFiles/test_cxx_variadic_templates.dir/cxx_variadic_templates.cpp.o
CompileFeatures/cxx_variadic_templates.cpp: In static member function ‘static int Interface<I, Is>::accumulate()’:
CompileFeatures/cxx_variadic_templates.cpp:18:31: sorry, unimplemented: cannot expand ‘Is ...’ into a fixed-length argument list
CMakeFiles/test_cxx_variadic_templates.dir/build.make:54: recipe for target 'CMakeFiles/test_cxx_variadic_templates.dir/cxx_variadic_templates.cpp.o' failed
The workaround is to use a specialization:
http://stackoverflow.com/questions/1989552http://stackoverflow.com/questions/11297376
Because not all compilers under test support the existing 'activation
features', add another test to ensure that compilers which support
both static_assert and nullptr behave as expected in this test.
The purpose of the feature listing in these tests is to make other
features from the same feature set (eg "C++11 features") available.
The compilers under test until now have supported these 'activation
features', but MSVC does not. Use the cxx_static_assert feature
instead to activate the feature set.
The tests below test the presence of both cxx_final and cxx_override,
only one of which is supported by MSVC. The test is in part intended
to verify that the COMPILE_FEATURES genex supports multiple arguments
and allows users to define names for groups of features (Clang already
calls cxx_final and cxx_override 'override control' as a group). Keep
the test, and allow the expectation to be set as appropriate.
Clang 3.4 uses C99 by default, and Clang 3.6 uses C11 by default:
http://thread.gmane.org/gmane.comp.compilers.clang.devel/39379
GNU 4.9 uses C90 by default, and GNU 5.0 uses C11 by default:
https://gcc.gnu.org/gcc-5/changes.html
Test that the default compiler settings result in the expected dialect
macros being defined for both C and CXX. Remove the unused main.c
file from the CompileFeatures unit test.
Allow setting build properties based on the features available
for a target. The availability of features is determined at
generate-time by evaluating the link implementation.
Ensure that the <LANG>_STANDARD determined while evaluating
COMPILE_FEATURES in the link implementation is not lower than that
provided by the INTERFACE of the link implementation. This is
similar to handling of transitive properties such as
POSITION_INDEPENDENT_CODE.
Add properties and variables corresponding to CXX equivalents.
Add features for c_function_prototypes (C90), c_restrict (C99),
c_variadic_macros (C99) and c_static_assert (C11). This feature
set can be extended later.
Add a <PREFIX>_RESTRICT symbol define to WriteCompilerDetectionHeader
to conditionally represent the c_restrict feature.
Remove the use of check_cxx_source_compiles which is now just getting in
the way.
Blacklist the cxx_alignof feature in the test with GNU 4.7. The test
file compiles, but it is documented as available first in GNU 4.8.