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:
parent
598a316154
commit
7565ab2cd1
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user