CMake/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake
Stephen Kelly c66e331749 Features: Use a more-common feature in cycle-test.
We require that the $<$<COMPILE_FEATURES:cxx_feature>:empty2> generates
a '1' when CXX11 is enabled.  GNU 4.4 does not support cxx_nullptr, but
does support cxx_auto_type.
2015-01-18 14:46:45 +01:00

16 lines
496 B
CMake

add_library(empty1 empty.cpp)
add_library(empty2 INTERFACE)
add_library(empty3 INTERFACE)
target_compile_features(empty3 INTERFACE cxx_static_assert)
target_link_libraries(empty1
# When starting, $<COMPILE_FEATURES:cxx_auto_type> is '0', so 'freeze' the
# CXX_STANDARD at 98 during computation.
$<$<COMPILE_FEATURES:cxx_auto_type>:empty2>
# This would add cxx_static_assert, but that would require CXX_STANDARD = 11,
# which is not allowed after freeze. Report an error.
empty3
)