-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ninja-restat-custom-command-byproducts' into release
- Loading branch information
Showing
3 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() | ||
") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters