Features: Test the CXX compiler only if it has features.

If using different C and CXX compilers, we might not have a
feature-full CXX compiler at this point.
This commit is contained in:
Stephen Kelly 2014-11-18 21:33:08 +01:00
parent 598a316154
commit 7565ab2cd1

View File

@ -77,6 +77,7 @@ foreach(lang CXX C)
endif()
endforeach()
if (CMAKE_CXX_COMPILE_FEATURES)
add_executable(CompileFeatures main.cpp)
set_property(TARGET CompileFeatures
PROPERTY COMPILE_FEATURES "cxx_auto_type"
@ -110,3 +111,4 @@ target_compile_features(noexcept_iface INTERFACE cxx_noexcept)
add_executable(CompileFeaturesGenex3 genex_test.cpp)
target_link_libraries(CompileFeaturesGenex3 PRIVATE noexcept_iface)
target_compile_definitions(CompileFeaturesGenex3 PRIVATE HAVE_OVERRIDE_CONTROL=$<COMPILE_FEATURES:cxx_final,cxx_override>)
endif()