diff options
author | Brad King <brad.king@kitware.com> | 2016-04-08 09:03:59 -0400 |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-04-08 09:03:59 -0400 |
commit | f6c5958047ee8a9084bf230a6c1acb4801cb2b93 (patch) | |
tree | 0822d1acd30fa67ad0a33b6c46a6303920d599c5 /Tests/RunCMake | |
parent | 1baf2cbd3dfd76aadcbfd84f6d42d13fcb838218 (diff) | |
parent | add7abc8352b87184579401cb2493c72e07aa212 (diff) | |
download | cmake-f6c5958047ee8a9084bf230a6c1acb4801cb2b93.tar.gz |
Merge topic 'ninja-restat-custom-command-byproducts'
add7abc8 Ninja: Restat custom command byproducts even with a SYMBOLIC output (#16049)
ff805113 Ninja: Fix detection of custom command symbolic outputs
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake | 28 | ||||
-rw-r--r-- | Tests/RunCMake/BuildDepends/RunCMakeTest.cmake | 1 |
2 files changed, 29 insertions, 0 deletions
diff --git a/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake b/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake new file mode 100644 index 0000000000..6948c35bf4 --- /dev/null +++ b/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake @@ -0,0 +1,28 @@ +add_custom_command( + OUTPUT gen-byproduct gen-byproduct-stamp + BYPRODUCTS byproduct + COMMAND ${CMAKE_COMMAND} -E touch gen-byproduct-stamp + COMMAND ${CMAKE_COMMAND} -E copy_if_different gen-byproduct-stamp byproduct + ) +set_property(SOURCE gen-byproduct PROPERTY SYMBOLIC 1) +add_custom_target(produce DEPENDS gen-byproduct) + +add_custom_command( + OUTPUT use-byproduct + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/byproduct + COMMAND ${CMAKE_COMMAND} -E touch use-byproduct + ) +add_custom_target(drive ALL DEPENDS use-byproduct) +add_dependencies(drive produce) + +file(GENERATE OUTPUT check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT " +if (check_step EQUAL 1) + set(check_pairs + \"${CMAKE_CURRENT_BINARY_DIR}/use-byproduct|${CMAKE_CURRENT_BINARY_DIR}/gen-byproduct-stamp\" + ) +else() + set(check_pairs + \"${CMAKE_CURRENT_BINARY_DIR}/gen-byproduct-stamp|${CMAKE_CURRENT_BINARY_DIR}/use-byproduct\" + ) +endif() +") diff --git a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake index 6b2b85a2bb..8541070565 100644 --- a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake +++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake @@ -39,6 +39,7 @@ if(NOT RunCMake_GENERATOR MATCHES "Visual Studio 7|Xcode") unset(run_BuildDepends_skip_step_2) endif() +run_BuildDepends(Custom-Symbolic-and-Byproduct) run_BuildDepends(Custom-Always) if(RunCMake_GENERATOR MATCHES "Make" AND |