CMP0175.rst 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. CMP0175
  2. -------
  3. .. versionadded:: 3.31
  4. :command:`add_custom_command` rejects invalid arguments.
  5. CMake 3.30 and earlier silently ignored unsupported keywords and missing or
  6. invalid arguments for the different forms of the :command:`add_custom_command`
  7. command. CMake 3.31 implements more rigorous argument checking and will flag
  8. invalid or missing arguments as errors.
  9. The ``OLD`` behavior of this policy will accept the same invalid keywords or
  10. arguments as CMake 3.30 and earlier. The ``NEW`` behavior will flag the
  11. following as errors that previously went unreported:
  12. * The ``OUTPUT`` form does not accept ``PRE_BUILD``, ``PRE_LINK``, or
  13. ``POST_BUILD`` keywords.
  14. * When the ``APPEND`` keyword is given, the ``OUTPUT`` form also does not
  15. accept ``BYPRODUCTS``, ``COMMAND_EXPAND_LISTS``, ``DEPENDS_EXPLICIT_ONLY``,
  16. ``DEPFILE``, ``JOB_POOL``, ``JOB_SERVER_AWARE``, ``USES_TERMINAL``, or
  17. ``VERBATIM`` keywords.
  18. * The ``TARGET`` form requires exactly one of ``PRE_BUILD``, ``PRE_LINK``, or
  19. ``POST_BUILD`` to be given. Previously, if none were given, ``POST_BUILD``
  20. was assumed, or if multiple keywords were given, the last one was used.
  21. * The ``TARGET`` form does not accept ``DEPENDS``, ``DEPENDS_EXPLICIT_ONLY``,
  22. ``DEPFILE``, ``IMPLICIT_DEPENDS``, ``MAIN_DEPENDENCY``, ``JOB_POOL``, or
  23. ``JOB_SERVER_AWARE`` keywords.
  24. * The ``TARGET`` form now requires at least one ``COMMAND`` to be given.
  25. * If a keyword expects a value to be given after it, but no value is provided,
  26. that was previously treated as though the keyword was not given at all.
  27. * The ``COMMENT`` keyword expects exactly one value after it. If multiple
  28. values are given, or if the ``COMMENT`` keyword is given more than once,
  29. this is an error.
  30. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.31
  31. .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
  32. .. include:: include/STANDARD_ADVICE.rst
  33. .. include:: include/DEPRECATED.rst