mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-26 08:08:24 -05:00
Tests: use cxx_auto_type only if actually available
The presence of CMAKE_CXX_COMPILE_FEATURES doesn't mean cxx_auto_type is always available.
This commit is contained in:
@@ -26,7 +26,7 @@ if (CMAKE_C_COMPILE_FEATURES)
|
|||||||
target_link_libraries(restrict_user lib_restrict)
|
target_link_libraries(restrict_user lib_restrict)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (CMAKE_CXX_COMPILE_FEATURES)
|
if (CMAKE_CXX_COMPILE_FEATURES AND ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_auto_type;")
|
||||||
if (CMAKE_C_COMPILE_FEATURES)
|
if (CMAKE_C_COMPILE_FEATURES)
|
||||||
set(target_suffix _cxx)
|
set(target_suffix _cxx)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -275,7 +275,10 @@ if (CMAKE_CXX_COMPILE_FEATURES)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
# these tests only work if at least cxx_auto_type is available
|
||||||
|
if (";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_auto_type;")
|
||||||
add_executable(CompileFeatures main.cpp)
|
add_executable(CompileFeatures main.cpp)
|
||||||
set_property(TARGET CompileFeatures
|
set_property(TARGET CompileFeatures
|
||||||
PROPERTY COMPILE_FEATURES "cxx_auto_type"
|
PROPERTY COMPILE_FEATURES "cxx_auto_type"
|
||||||
|
|||||||
Reference in New Issue
Block a user