diff options
author | Brad King <brad.king@kitware.com> | 2021-08-03 14:58:50 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-08-03 14:59:38 (GMT) |
commit | e251bf5f68812f6665de771b2a7ef4c3c2ab79e0 (patch) | |
tree | cd83b11bc1a4838f6c5340c8566d8d624850f41a /Tests | |
parent | b554d08c9b982a2e063954540d08985409f07896 (diff) | |
parent | 9e7a0568f604852af6994bebecf580b825b3ae36 (diff) | |
download | CMake-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.cmake | 9 | ||||
-rw-r--r-- | Tests/RunCMake/BuildDepends/RunCMakeTest.cmake | 4 |
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 |