CMP0166.rst 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. CMP0166
  2. -------
  3. .. versionadded:: 3.30
  4. :genex:`TARGET_PROPERTY` evaluates link properties transitively over private
  5. dependencies of static libraries.
  6. In CMake 3.29 and below, the :genex:`TARGET_PROPERTY` generator expression
  7. evaluates properties :prop_tgt:`INTERFACE_LINK_OPTIONS`,
  8. :prop_tgt:`INTERFACE_LINK_DIRECTORIES`, and :prop_tgt:`INTERFACE_LINK_DEPENDS`
  9. as if they were :ref:`Transitive Compile Properties` rather than
  10. :ref:`Transitive Link Properties`, even when policy :policy:`CMP0099` is
  11. set to ``NEW``. Private dependencies of static libraries, which appear in
  12. their :prop_tgt:`INTERFACE_LINK_LIBRARIES` guarded by :genex:`LINK_ONLY`
  13. generator expressions, are not followed. This is inconsistent with
  14. evaluation of the same target properties during buildsystem generation.
  15. CMake 3.30 and above prefer that :genex:`TARGET_PROPERTY` evaluates
  16. properties :prop_tgt:`INTERFACE_LINK_OPTIONS`,
  17. :prop_tgt:`INTERFACE_LINK_DIRECTORIES`, and :prop_tgt:`INTERFACE_LINK_DEPENDS`
  18. as :ref:`Transitive Link Properties` such that private dependencies of static
  19. libraries, which appear in their :prop_tgt:`INTERFACE_LINK_LIBRARIES` guarded
  20. by :genex:`LINK_ONLY` generator expressions, are followed.
  21. This policy provides compatibility for projects that have not been updated
  22. to expect the new behavior.
  23. The ``OLD`` behavior for this policy is for :genex:`TARGET_PROPERTY` to
  24. evaluate properties :prop_tgt:`INTERFACE_LINK_OPTIONS`,
  25. :prop_tgt:`INTERFACE_LINK_DIRECTORIES`, and :prop_tgt:`INTERFACE_LINK_DEPENDS`
  26. as if they were :ref:`Transitive Compile Properties` by not following private
  27. dependencies of static libraries. The ``NEW`` behavior for this policy is
  28. to evaluate them as :ref:`Transitive Link Properties` by following private
  29. dependencies of static libraries.
  30. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.30
  31. .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
  32. .. include:: include/STANDARD_ADVICE.rst
  33. .. include:: include/DEPRECATED.rst