summaryrefslogtreecommitdiff
path: root/Tests/CustomCommand
diff options
context:
space:
mode:
authorShannon Booth <shannon.ml.booth@gmail.com>2020-12-23 12:57:50 +1300
committerBrad King <brad.king@kitware.com>2020-12-23 09:59:03 -0500
commitd43f4692e0c5e6f71305be74fbed7c6120057d9d (patch)
tree2a696060ac2ea23dbca178c79dc1f4cd184e8ef6 /Tests/CustomCommand
parentc56d3bef3e6b105465c41cc241ab26cce2327393 (diff)
downloadcmake-d43f4692e0c5e6f71305be74fbed7c6120057d9d.tar.gz
Ninja: Omit custom commands with an empty COMMAND
Fixes: #21063
Diffstat (limited to 'Tests/CustomCommand')
-rw-r--r--Tests/CustomCommand/CMakeLists.txt4
-rw-r--r--Tests/CustomCommand/empty_command.cxx4
2 files changed, 8 insertions, 0 deletions
diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt
index c1a7a57684..80545c483a 100644
--- a/Tests/CustomCommand/CMakeLists.txt
+++ b/Tests/CustomCommand/CMakeLists.txt
@@ -582,3 +582,7 @@ set_target_properties(mac_fw PROPERTIES
)
add_custom_command(OUTPUT mac_fw.txt COMMAND ${CMAKE_COMMAND} -E touch mac_fw.txt DEPENDS mac_fw)
add_custom_target(drive_mac_fw ALL DEPENDS mac_fw.txt)
+
+# Test empty COMMANDs are ommited
+add_executable(empty_command empty_command.cxx)
+add_custom_command(TARGET empty_command POST_BUILD COMMAND $<0:date>)
diff --git a/Tests/CustomCommand/empty_command.cxx b/Tests/CustomCommand/empty_command.cxx
new file mode 100644
index 0000000000..f8b643afbf
--- /dev/null
+++ b/Tests/CustomCommand/empty_command.cxx
@@ -0,0 +1,4 @@
+int main()
+{
+ return 0;
+}