Kaynağa Gözat

Merge topic 'cmp0175-restore-USES_TERMINAL-for-TARGET-form' into release-3.31

62586f236c CMP0175: Do not reject USES_TERMINAL for add_custom_command(TARGET)

Acked-by: Kitware Robot <[email protected]>
Tested-by: buildbot <[email protected]>
Merge-request: !10005
Craig Scott 11 ay önce
ebeveyn
işleme
74c1b88859

+ 2 - 1
Help/command/add_custom_command.rst

@@ -599,7 +599,8 @@ target is already built, the command will not execute.
                      [WORKING_DIRECTORY dir]
                      [COMMENT comment]
                      [VERBATIM]
-                     [COMMAND_EXPAND_LISTS])
+                     [COMMAND_EXPAND_LISTS]
+                     [USES_TERMINAL])
 
 This defines a new command that will be associated with building the
 specified ``<target>``.  The ``<target>`` must be defined in the current

+ 2 - 2
Help/policy/CMP0175.rst

@@ -24,8 +24,8 @@ following as errors that previously went unreported:
   ``POST_BUILD`` to be given.  Previously, if none were given, ``POST_BUILD``
   was assumed, or if multiple keywords were given, the last one was used.
 * The ``TARGET`` form does not accept ``DEPENDS``, ``DEPENDS_EXPLICIT_ONLY``,
-  ``DEPFILE``, ``IMPLICIT_DEPENDS``, ``MAIN_DEPENDENCY``, ``JOB_POOL``,
-  ``JOB_SERVER_AWARE``, or ``USES_TERMINAL`` keywords.
+  ``DEPFILE``, ``IMPLICIT_DEPENDS``, ``MAIN_DEPENDENCY``, ``JOB_POOL``, or
+  ``JOB_SERVER_AWARE`` keywords.
 * The ``TARGET`` form now requires at least one ``COMMAND`` to be given.
 * If a keyword expects a value to be given after it, but no value is provided,
   that was previously treated as though the keyword was not given at all.

+ 1 - 0
Source/cmAddCustomCommandCommand.cxx

@@ -155,6 +155,7 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args,
     keyPRE_BUILD,
     keyPRE_LINK,
     keyTARGET,
+    keyUSES_TERMINAL,
     keyVERBATIM,
     keyWORKING_DIRECTORY
   };

+ 1 - 1
Tests/RunCMake/add_custom_command/CMP0175-NEW-stderr.txt

@@ -9,7 +9,7 @@ Call Stack \(most recent call first\):
 
 CMake Error at CMP0175\.cmake:[0-9]+ \(add_custom_command\):
   The following keywords are not supported when using
-  add_custom_command\(TARGET\): IMPLICIT_DEPENDS, USES_TERMINAL
+  add_custom_command\(TARGET\): IMPLICIT_DEPENDS
 Call Stack \(most recent call first\):
   CMP0175-NEW\.cmake:2 \(include\)
   CMakeLists\.txt:3 \(include\)

+ 1 - 1
Tests/RunCMake/add_custom_command/CMP0175-WARN-stderr.txt

@@ -13,7 +13,7 @@ This warning is for project developers\.  Use -Wno-dev to suppress it\.
 
 CMake Warning \(dev\) at CMP0175\.cmake:[0-9]+ \(add_custom_command\):
   The following keywords are not supported when using
-  add_custom_command\(TARGET\): IMPLICIT_DEPENDS, USES_TERMINAL\.
+  add_custom_command\(TARGET\): IMPLICIT_DEPENDS\.
 
   Policy CMP0175 is not set: add_custom_command\(\) rejects invalid arguments\.
   Run "cmake --help-policy CMP0175" for policy details\.  Use the cmake_policy

+ 3 - 2
Tests/RunCMake/add_custom_command/CMP0175.cmake

@@ -24,14 +24,15 @@ add_custom_command(TARGET main
   #OUTPUT   # Other checks will fail before the CMP0175 check
   #OUTPUTS  # Special case, not a documented keyword (used for deprecated form)
   #SOURCE   # Old signature, special handling makes it hard to check
-  #USES_TERMINAL
 )
 add_custom_command(TARGET main
   POST_BUILD
   COMMAND ${CMAKE_COMMAND} -E true
   # Has to be tested separately due to separate check for clash with DEPFILE
   IMPLICIT_DEPENDS valueDoesNotMatterHere
-  # Has to be tested separately due to separate check for clash with JOB_POOL
+  # Has to be tested separately due to separate check for clash with JOB_POOL.
+  # This one is supported, but was erroneously rejected in the 3.31.0 release.
+  # We keep this here to verify the fix for that regression.
   USES_TERMINAL NO
 )