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)
commite251bf5f68812f6665de771b2a7ef4c3c2ab79e0 (patch)
treecd83b11bc1a4838f6c5340c8566d8d624850f41a /Tests
parentb554d08c9b982a2e063954540d08985409f07896 (diff)
parent9e7a0568f604852af6994bebecf580b825b3ae36 (diff)
downloadCMake-e251bf5f68812f6665de771b2a7ef4c3c2ab79e0.zip
CMake-e251bf5f68812f6665de771b2a7ef4c3c2ab79e0.tar.gz
CMake-e251bf5f68812f6665de771b2a7ef4c3c2ab79e0.tar.bz2
Merge topic 'CC-DEPFILE-independent-from-CMAKE_DEPENDS_USE_COMPILER'
9e7a0568f6 Merge branch 'backport-3.21-CC-DEPFILE-independent-from-CMAKE_DEPENDS_USE_COMPILER' into CC-DEPFILE-independent-from-CMAKE_DEPENDS_USE_COMPILER 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