CMP0131.rst 1.2 KB

123456789101112131415161718192021222324252627282930
  1. CMP0131
  2. -------
  3. .. versionadded:: 3.24
  4. :prop_tgt:`LINK_LIBRARIES` supports the :genex:`$<LINK_ONLY:...>`
  5. generator expression.
  6. CMake 3.23 and below documented the :genex:`$<LINK_ONLY:...>` generator
  7. expression only for use in :prop_tgt:`INTERFACE_LINK_LIBRARIES`.
  8. When used in :prop_tgt:`LINK_LIBRARIES`, the content guarded inside
  9. :genex:`$<LINK_ONLY:...>` was always used, even when collecting non-linking
  10. usage requirements such as :prop_tgt:`INTERFACE_COMPILE_DEFINITIONS`.
  11. CMake 3.24 and above prefer to support :genex:`$<LINK_ONLY:...>`, when
  12. used in :prop_tgt:`LINK_LIBRARIES`, by using the guarded content only
  13. for link dependencies and not other usage requirements. This policy
  14. provides compatibility for projects that have not been updated to
  15. account for this change.
  16. The ``OLD`` behavior for this policy is to use :prop_tgt:`LINK_LIBRARIES`
  17. content guarded by :genex:`$<LINK_ONLY:...>` even for non-linking
  18. usage requirements. The ``NEW`` behavior for this policy is to use
  19. the guarded content only for link dependencies.
  20. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.24
  21. .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
  22. .. include:: STANDARD_ADVICE.txt
  23. .. include:: DEPRECATED.txt