summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2021-08-01 13:26:21 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2021-08-01 13:26:21 (GMT)
commit9e7a0568f604852af6994bebecf580b825b3ae36 (patch)
tree9597c10f96c1bb923cbf001b5724b99bd94804ad /Tests
parent0a6415ea1fa286346f119809323938a7cfca8565 (diff)
parent213fec4908a13bb0f414533eddfd72481bc50694 (diff)
downloadCMake-9e7a0568f604852af6994bebecf580b825b3ae36.zip
CMake-9e7a0568f604852af6994bebecf580b825b3ae36.tar.gz
CMake-9e7a0568f604852af6994bebecf580b825b3ae36.tar.bz2
Merge branch 'backport-3.21-CC-DEPFILE-independent-from-CMAKE_DEPENDS_USE_COMPILER' into CC-DEPFILE-independent-from-CMAKE_DEPENDS_USE_COMPILER
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