瀏覽代碼

Help: State behavior for add_custom_command(TARGET) without event type

Projects should always have specified one of PRE_BUILD, PRE_LINK or
POST_BUILD, and the documentation has always shown that one must
be given. But the argument parsing logic was such that if none was given,
POST_BUILD would be used and no error or warning would be raised.
Projects may be relying on this behavior, so document it as formally
supported, but not recommended.

Fixes: #23488
Craig Scott 3 年之前
父節點
當前提交
8cf8f4d13b
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      Help/command/add_custom_command.rst

+ 5 - 0
Help/command/add_custom_command.rst

@@ -425,6 +425,11 @@ of the following is specified:
 ``POST_BUILD``
   Run after all other rules within the target have been executed.
 
+Projects should always specify one of the above three keywords when using
+the ``TARGET`` form.  For backward compatibility reasons, ``POST_BUILD`` is
+assumed if no such keyword is given, but projects should explicitly provide
+one of the keywords to make clear the behavior they expect.
+
 .. note::
   Because generator expressions can be used in custom commands,
   it is possible to define ``COMMAND`` lines or whole custom commands