summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/Make
diff options
context:
space:
mode:
authorKulla Christoph <christoph.kulla@de.bosch.com>2016-08-05 14:39:31 +0200
committerBrad King <brad.king@kitware.com>2016-08-30 09:05:18 -0400
commit048d1adb4ede50e49dce00873a5961e424e149f9 (patch)
tree2f7ec3c0e5a773820c8cd74efa90c12124bbcce3 /Tests/RunCMake/Make
parent98caa14cc84cc659c2c5b51f84c6547b57c89c30 (diff)
downloadcmake-048d1adb4ede50e49dce00873a5961e424e149f9.tar.gz
add_custom_command: Add DEPFILE option for Ninja
Provide a way for custom commands to inform the ninja build tool about their implicit dependencies. For now simply make use of the option an error on other generators. Closes: #15479
Diffstat (limited to 'Tests/RunCMake/Make')
-rw-r--r--Tests/RunCMake/Make/CustomCommandDepfile-ERROR-result.txt1
-rw-r--r--Tests/RunCMake/Make/CustomCommandDepfile-ERROR-stderr.txt5
-rw-r--r--Tests/RunCMake/Make/CustomCommandDepfile-ERROR.cmake8
-rw-r--r--Tests/RunCMake/Make/RunCMakeTest.cmake2
4 files changed, 16 insertions, 0 deletions
diff --git a/Tests/RunCMake/Make/CustomCommandDepfile-ERROR-result.txt b/Tests/RunCMake/Make/CustomCommandDepfile-ERROR-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/Make/CustomCommandDepfile-ERROR-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Make/CustomCommandDepfile-ERROR-stderr.txt b/Tests/RunCMake/Make/CustomCommandDepfile-ERROR-stderr.txt
new file mode 100644
index 0000000000..74d62a47df
--- /dev/null
+++ b/Tests/RunCMake/Make/CustomCommandDepfile-ERROR-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Error at CustomCommandDepfile-ERROR.cmake:1 \(add_custom_command\):
+ add_custom_command Option DEPFILE not supported by [^
+]+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Make/CustomCommandDepfile-ERROR.cmake b/Tests/RunCMake/Make/CustomCommandDepfile-ERROR.cmake
new file mode 100644
index 0000000000..bad7955017
--- /dev/null
+++ b/Tests/RunCMake/Make/CustomCommandDepfile-ERROR.cmake
@@ -0,0 +1,8 @@
+add_custom_command(
+ OUTPUT hello.copy.c
+ COMMAND "${CMAKE_COMMAND}" -E copy
+ "${CMAKE_CURRENT_SOURCE_DIR}/hello.c"
+ hello.copy.c
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+ DEPFILE "test.d"
+ )
diff --git a/Tests/RunCMake/Make/RunCMakeTest.cmake b/Tests/RunCMake/Make/RunCMakeTest.cmake
index c6bbd03c04..869d11e5d2 100644
--- a/Tests/RunCMake/Make/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Make/RunCMakeTest.cmake
@@ -15,3 +15,5 @@ run_TargetMessages(OFF)
run_TargetMessages(VAR-ON -DCMAKE_TARGET_MESSAGES=ON)
run_TargetMessages(VAR-OFF -DCMAKE_TARGET_MESSAGES=OFF)
+
+run_cmake(CustomCommandDepfile-ERROR)