CMP0171.rst 1.1 KB

1234567891011121314151617181920212223242526
  1. CMP0171
  2. -------
  3. .. versionadded:: 3.31
  4. ``codegen`` is a reserved target name.
  5. CMake 3.30 and earlier did not reserve ``codegen`` as a builtin target name,
  6. leaving projects free to create their own target with that name.
  7. CMake 3.31 and later prefer to reserve ``codegen`` as a builtin target name
  8. to drive custom commands created with the ``CODEGEN`` option to
  9. :command:`add_custom_command`. In order to support building the ``codegen``
  10. target in scripted environments, e.g., ``cmake --build . --target codegen``,
  11. the ``codegen`` target needs to be generated even if no custom commands
  12. use the ``CODEGEN`` option. This policy provides compatibility for projects
  13. that have not been updated to avoid creating a target named ``codegen``.
  14. The ``OLD`` behavior of this policy allows projects to create a target
  15. with the name ``codegen``. The ``NEW`` behavior halts with a fatal error
  16. if a target with the name ``codegen`` is created.
  17. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.31
  18. .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
  19. .. include:: STANDARD_ADVICE.txt
  20. .. include:: DEPRECATED.txt