diff options
Diffstat (limited to 'Tests/RunCMake/Ninja')
-rw-r--r-- | Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake | 5 | ||||
-rw-r--r-- | Tests/RunCMake/Ninja/CustomCommandDepfile.cmake | 11 | ||||
-rw-r--r-- | Tests/RunCMake/Ninja/RunCMakeTest.cmake | 2 |
3 files changed, 18 insertions, 0 deletions
diff --git a/Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake b/Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake new file mode 100644 index 0000000..189de64 --- /dev/null +++ b/Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake @@ -0,0 +1,5 @@ +set(log "${RunCMake_BINARY_DIR}/CustomCommandDepfile-build/build.ninja") +file(READ "${log}" build_file) +if(NOT "${build_file}" MATCHES "depfile = test\\.d") + set(RunCMake_TEST_FAILED "Log file:\n ${log}\ndoes not have expected line: depfile = test.d") +endif() diff --git a/Tests/RunCMake/Ninja/CustomCommandDepfile.cmake b/Tests/RunCMake/Ninja/CustomCommandDepfile.cmake new file mode 100644 index 0000000..dbef2a5 --- /dev/null +++ b/Tests/RunCMake/Ninja/CustomCommandDepfile.cmake @@ -0,0 +1,11 @@ +add_custom_command( + OUTPUT hello.copy.c + COMMAND "${CMAKE_COMMAND}" -E copy + "${CMAKE_CURRENT_SOURCE_DIR}/hello.c" + hello.copy.c + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + DEPFILE "test.d" + ) +add_custom_target(copy ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/hello.copy.c") + +include(CheckNoPrefixSubDir.cmake) diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake index 622c327..778f2c1 100644 --- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake +++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake @@ -32,6 +32,8 @@ run_CMP0058(WARN-by) run_CMP0058(NEW-no) run_CMP0058(NEW-by) +run_cmake(CustomCommandDepfile) + function(run_SubDir) # Use a single build tree for a few tests without cleaning. set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SubDir-build) |