diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-05-15 09:32:30 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-05-21 15:22:32 (GMT) |
commit | 0dfe395e3cb1a720c4853087db554a6827feaadb (patch) | |
tree | 83d9cbe0ee9843bc4aa0012d9a7064a3522ba018 /Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake | |
parent | aa8a6fcee8c67b0516efcd745fb1d7a66d249096 (diff) | |
download | CMake-0dfe395e3cb1a720c4853087db554a6827feaadb.zip CMake-0dfe395e3cb1a720c4853087db554a6827feaadb.tar.gz CMake-0dfe395e3cb1a720c4853087db554a6827feaadb.tar.bz2 |
Features: Add COMPILE_FEATURES generator expression.
Allow setting build properties based on the features available
for a target. The availability of features is determined at
generate-time by evaluating the link implementation.
Ensure that the <LANG>_STANDARD determined while evaluating
COMPILE_FEATURES in the link implementation is not lower than that
provided by the INTERFACE of the link implementation. This is
similar to handling of transitive properties such as
POSITION_INDEPENDENT_CODE.
Diffstat (limited to 'Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake')
-rw-r--r-- | Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake b/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake new file mode 100644 index 0000000..c6707c1 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake @@ -0,0 +1,17 @@ + +set(genexvar $<COMPILE_FEATURES:cxx_final>) + +if (HAVE_FINAL) + set(expected_result 1) +else() + set(expected_result 0) +endif() + +add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file${HAVE_FINAL}.cpp" + COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file${genexvar}.cpp" +) + +add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file${genexvar}.cpp") +if (HAVE_FINAL) + target_compile_features(empty PRIVATE cxx_final) +endif() |