cmake/Help/prop_tgt/LINK_WHAT_YOU_USE.rst

24 lines
950 B
ReStructuredText
Raw Normal View History

2016-10-30 18:24:19 +01:00
LINK_WHAT_YOU_USE
2021-11-20 13:41:27 +01:00
-----------------
2016-10-30 18:24:19 +01:00
2021-09-14 00:13:48 +02:00
.. versionadded:: 3.7
2021-11-20 13:41:27 +01:00
This is a boolean option that, when set to ``TRUE``, will automatically run
contents of variable :variable:`CMAKE_LINK_WHAT_YOU_USE_CHECK` on the target
after it is linked. In addition, the linker flag specified by variable
:variable:`CMAKE_<LANG>_LINK_WHAT_YOU_USE_FLAG` will be passed to the target
with the link command so that all libraries specified on the command line will
be linked into the target. This will result in the link producing a list of
libraries that provide no symbols used by this target but are being linked to
it.
.. note::
For now, it is only supported for ``ELF`` platforms and is only applicable to
executable and shared or module library targets. This property will be
ignored for any other targets and configurations.
2016-10-30 18:24:19 +01:00
This property is initialized by the value of
the :variable:`CMAKE_LINK_WHAT_YOU_USE` variable if it is set
when a target is created.