summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-08-03 14:58:50 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-08-03 14:59:38 (GMT)
commit54be23df7f39d14aad3eb57e6bf8d5afa59f07a5 (patch)
tree40a8afcc65601f5c1d8ed12e6c3b3270737390fc /Tests
parentaa1426da4a73ceb4ca53ddb4bd85d77b92f2491b (diff)
parent213fec4908a13bb0f414533eddfd72481bc50694 (diff)
downloadCMake-54be23df7f39d14aad3eb57e6bf8d5afa59f07a5.zip
CMake-54be23df7f39d14aad3eb57e6bf8d5afa59f07a5.tar.gz
CMake-54be23df7f39d14aad3eb57e6bf8d5afa59f07a5.tar.bz2
Merge topic 'CC-DEPFILE-independent-from-CMAKE_DEPENDS_USE_COMPILER' into release-3.21
213fec4908 add_custom_command(DEPFILE) independent from CMAKE_DEPENDS_USE_COMPILER Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6421
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/BuildDepends/CustomCommandDependencies-compiler-deps-legacy.cmake9
-rw-r--r--Tests/RunCMake/BuildDepends/RunCMakeTest.cmake4
2 files changed, 13 insertions, 0 deletions
diff --git a/Tests/RunCMake/BuildDepends/CustomCommandDependencies-compiler-deps-legacy.cmake b/Tests/RunCMake/BuildDepends/CustomCommandDependencies-compiler-deps-legacy.cmake
new file mode 100644
index 0000000..e13efb3
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/CustomCommandDependencies-compiler-deps-legacy.cmake
@@ -0,0 +1,9 @@
+enable_language(C)
+
+add_custom_command(OUTPUT main.c
+ DEPFILE main.c.d
+ COMMAND "${CMAKE_COMMAND}" -DINFILE=${CMAKE_CURRENT_SOURCE_DIR}/main.c -DOUTFILE=main.c -DDEPFILE=main.c.d
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/GenerateDepFile.cmake"
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
+
+add_executable(main ${CMAKE_CURRENT_BINARY_DIR}/main.c)
diff --git a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
index f8c20c2..27bbff6 100644
--- a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
+++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
@@ -170,6 +170,10 @@ endif()
if (RunCMake_GENERATOR MATCHES "Makefiles")
run_cmake(CustomCommandDependencies-BadArgs)
+ run_cmake_with_options(CustomCommandDependencies-compiler-deps-legacy -DCMAKE_DEPENDS_USE_COMPILER=FALSE)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(CustomCommandDependencies-compiler-deps-legacy ${CMAKE_COMMAND} --build . --config Debug)
+ unset(RunCMake_TEST_NO_CLEAN)
endif()
if(RunCMake_GENERATOR MATCHES "Make|Ninja|Visual Studio|Xcode" AND