diff options
author | Brad King <brad.king@kitware.com> | 2021-06-03 12:18:32 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-06-03 12:18:32 (GMT) |
commit | 95faf9cb966d03899d6b3c3f6d8c48c46386fadd (patch) | |
tree | 94b06b681df3b8ac418d6da33b1b90d4f51e0657 /Tests/RunCMake/Ninja | |
parent | 9d7ebb47ea30a75617778686ba187fa6d5e91f45 (diff) | |
parent | 9c33ff4dda643f8a93d55f9895e31dce9056134f (diff) | |
download | CMake-95faf9cb966d03899d6b3c3f6d8c48c46386fadd.zip CMake-95faf9cb966d03899d6b3c3f6d8c48c46386fadd.tar.gz CMake-95faf9cb966d03899d6b3c3f6d8c48c46386fadd.tar.bz2 |
Merge branch 'master' into ci-sccache-consistent-builds
Diffstat (limited to 'Tests/RunCMake/Ninja')
-rw-r--r-- | Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake | 7 | ||||
-rw-r--r-- | Tests/RunCMake/Ninja/CustomCommandDepfile.cmake | 13 | ||||
-rw-r--r-- | Tests/RunCMake/Ninja/RunCMakeTest.cmake | 6 |
3 files changed, 21 insertions, 5 deletions
diff --git a/Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake b/Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake index 189de64..51f4f52 100644 --- a/Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake +++ b/Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake @@ -1,5 +1,10 @@ set(log "${RunCMake_BINARY_DIR}/CustomCommandDepfile-build/build.ninja") file(READ "${log}" build_file) + +set(RunCMake_TEST_FAILED) if(NOT "${build_file}" MATCHES "depfile = test\\.d") - set(RunCMake_TEST_FAILED "Log file:\n ${log}\ndoes not have expected line: depfile = test.d") + list(APPEND RunCMake_TEST_FAILED "Log file:\n ${log}\ndoes not have expected line: depfile = test.d") +endif() +if(NOT "${build_file}" MATCHES "depfile = test_Debug\\.d") + list(APPEND RunCMake_TEST_FAILED "\nLog file:\n ${log}\ndoes not have expected line: depfile = test_Debug.d") endif() diff --git a/Tests/RunCMake/Ninja/CustomCommandDepfile.cmake b/Tests/RunCMake/Ninja/CustomCommandDepfile.cmake index dbef2a5..0838d14 100644 --- a/Tests/RunCMake/Ninja/CustomCommandDepfile.cmake +++ b/Tests/RunCMake/Ninja/CustomCommandDepfile.cmake @@ -6,6 +6,17 @@ add_custom_command( WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" DEPFILE "test.d" ) -add_custom_target(copy ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/hello.copy.c") + +add_custom_command( + OUTPUT hello.copy2.c + COMMAND "${CMAKE_COMMAND}" -E copy + "${CMAKE_CURRENT_SOURCE_DIR}/hello.c" + hello.copy2.c + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + DEPFILE "test_$<CONFIG>.d" + ) + +add_custom_target(copy ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/hello.copy.c" + "${CMAKE_CURRENT_BINARY_DIR}/hello.copy2.c") include(CheckNoPrefixSubDir.cmake) diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake index 0c0619d..8c91b34 100644 --- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake +++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake @@ -67,7 +67,7 @@ run_CMP0058(WARN-by) run_CMP0058(NEW-no) run_CMP0058(NEW-by) -run_cmake(CustomCommandDepfile) +run_cmake_with_options(CustomCommandDepfile -DCMAKE_BUILD_TYPE=Debug) run_cmake(CustomCommandJobPool) run_cmake(JobPoolUsesTerminal) @@ -163,12 +163,12 @@ run_LooseObjectDepends() function (run_AssumedSources) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/AssumedSources-build) run_cmake(AssumedSources) - run_ninja("${RunCMake_TEST_BINARY_DIR}" "target.c") + run_ninja("${RunCMake_TEST_BINARY_DIR}" "${RunCMake_TEST_BINARY_DIR}/target.c") if (NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/target.c") message(FATAL_ERROR "Dependencies for an assumed source did not hook up properly for 'target.c'.") endif () - run_ninja("${RunCMake_TEST_BINARY_DIR}" "target-no-depends.c") + run_ninja("${RunCMake_TEST_BINARY_DIR}" "${RunCMake_TEST_BINARY_DIR}/target-no-depends.c") if (EXISTS "${RunCMake_TEST_BINARY_DIR}/target-no-depends.c") message(FATAL_ERROR "Dependencies for an assumed source were magically hooked up for 'target-no-depends.c'.") |