Features: Test an expectation of whether OVERRIDE_CONTROL is expected

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.
This commit is contained in:
Stephen Kelly 2015-01-03 14:57:31 +01:00
parent 24dfa74214
commit b3e86f4e97
2 changed files with 4 additions and 0 deletions

View File

@ -120,6 +120,8 @@ if (CMAKE_CXX_COMPILE_FEATURES)
add_executable(IfaceCompileFeatures main.cpp)
target_link_libraries(IfaceCompileFeatures iface)
add_definitions(-DEXPECT_OVERRIDE_CONTROL=1)
add_executable(CompileFeaturesGenex genex_test.cpp)
set_property(TARGET CompileFeaturesGenex PROPERTY CXX_STANDARD 11)
target_compile_definitions(CompileFeaturesGenex PRIVATE HAVE_OVERRIDE_CONTROL=$<COMPILE_FEATURES:cxx_final,cxx_override>)

View File

@ -1,6 +1,8 @@
#if !HAVE_OVERRIDE_CONTROL
#if EXPECT_OVERRIDE_CONTROL
#error "Expect override control feature"
#endif
#else
struct A