CMP0210.rst 1.1 KB

123456789101112131415161718192021222324252627282930
  1. CMP0210
  2. -------
  3. .. versionadded:: 4.3
  4. :variable:`CMAKE_<LANG>_LINK_FLAGS` adds link flags to all target types.
  5. In CMake 4.2 and below, :variable:`CMAKE_<LANG>_LINK_FLAGS` held flags
  6. relevant to target creation and applied when linking executables only. It was
  7. undocumented and originally intended for internal use only, but still
  8. available for projects and users to set in order to control linking behavior.
  9. CMake 4.3 and above repurpose this variable to add per-language link flags for
  10. all target types that link (executables, shared libraries, and module
  11. libraries).
  12. This policy provides compatibility with projects that relied on this variable
  13. and have not been updated to be aware of the change.
  14. The ``OLD`` behavior for this policy is to apply
  15. :variable:`CMAKE_<LANG>_LINK_FLAGS` to invocations of the compiler which drive
  16. linking for executables only. The ``NEW`` behavior is to apply the flags to
  17. all target types.
  18. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.3
  19. .. |WARNS_OR_DOES_NOT_WARN| replace::
  20. warns when :variable:`CMAKE_<LANG>_LINK_FLAGS` is set
  21. .. include:: include/STANDARD_ADVICE.rst
  22. .. include:: include/DEPRECATED.rst