summaryrefslogtreecommitdiffstats
path: root/Help/command
diff options
context:
space:
mode:
authorAbdelmaged Khalifa <abdelmaged.khalifa@gmail.com>2023-02-11 23:00:40 (GMT)
committerBrad King <brad.king@kitware.com>2023-02-14 13:56:59 (GMT)
commit082ccd75301cd02efd09bb9882bb9d2a8957193b (patch)
tree92611f898b4b3253c12687faa610f0bc8a0d0de8 /Help/command
parent48c69eeafe5e480b5baa0c6766d4d2e3c7f5a4ad (diff)
downloadCMake-082ccd75301cd02efd09bb9882bb9d2a8957193b.zip
CMake-082ccd75301cd02efd09bb9882bb9d2a8957193b.tar.gz
CMake-082ccd75301cd02efd09bb9882bb9d2a8957193b.tar.bz2
add_custom_command: Add DEPENDS_EXPLICIT_ONLY option for Ninja
Add option `DEPENDS_EXPLICIT_ONLY` to `add_custom_command` to indicate that implicit dependencies coming from users of the output are not needed, and only consider dependencies explicitly specified in the custom command. Fixes: #17097
Diffstat (limited to 'Help/command')
-rw-r--r--Help/command/add_custom_command.rst18
1 files changed, 17 insertions, 1 deletions
diff --git a/Help/command/add_custom_command.rst b/Help/command/add_custom_command.rst
index 293d3f0..2cf88fc 100644
--- a/Help/command/add_custom_command.rst
+++ b/Help/command/add_custom_command.rst
@@ -25,7 +25,8 @@ The first signature is for adding a custom command to produce an output:
[DEPFILE depfile]
[JOB_POOL job_pool]
[VERBATIM] [APPEND] [USES_TERMINAL]
- [COMMAND_EXPAND_LISTS])
+ [COMMAND_EXPAND_LISTS]
+ [DEPENDS_EXPLICIT_ONLY])
This defines a command to generate specified ``OUTPUT`` file(s).
A target created in the same directory (``CMakeLists.txt`` file)
@@ -357,6 +358,21 @@ The options are:
:ref:`Makefile Generators`, :ref:`Visual Studio Generators`,
and the :generator:`Xcode` generator.
+``DEPENDS_EXPLICIT_ONLY``
+
+ .. versionadded:: 3.27
+
+ Indicate that the command's ``DEPENDS`` argument represents all files
+ required by the command and implicit dependencies are not required.
+
+ Without this option, if any target uses the output of the custom command,
+ CMake will consider that target's dependencies as implicit dependencies for
+ the custom command in case this custom command requires files implicitly
+ created by those targets.
+
+ Only the :ref:`Ninja Generators` actually use this information to remove
+ unnecessary implicit dependencies.
+
Examples: Generating Files
^^^^^^^^^^^^^^^^^^^^^^^^^^