LINK_WHAT_YOU_USE.rst 950 B

1234567891011121314151617181920212223
  1. LINK_WHAT_YOU_USE
  2. -----------------
  3. .. versionadded:: 3.7
  4. This is a boolean option that, when set to ``TRUE``, will automatically run
  5. contents of variable :variable:`CMAKE_LINK_WHAT_YOU_USE_CHECK` on the target
  6. after it is linked. In addition, the linker flag specified by variable
  7. :variable:`CMAKE_<LANG>_LINK_WHAT_YOU_USE_FLAG` will be passed to the target
  8. with the link command so that all libraries specified on the command line will
  9. be linked into the target. This will result in the link producing a list of
  10. libraries that provide no symbols used by this target but are being linked to
  11. it.
  12. .. note::
  13. For now, it is only supported for ``ELF`` platforms and is only applicable to
  14. executable and shared or module library targets. This property will be
  15. ignored for any other targets and configurations.
  16. This property is initialized by the value of
  17. the :variable:`CMAKE_LINK_WHAT_YOU_USE` variable if it is set
  18. when a target is created.