Help: LINK_LIBRARY:WHOLE_ARCHIVE clarification

Fixes: #26540
This commit is contained in:
Marc Chevrier
2024-12-18 16:57:02 +01:00
parent 1beb742d1b
commit 7baf4a9aeb

View File

@@ -5,8 +5,10 @@
:prop_tgt:`LINK_LIBRARY_OVERRIDE_<LIBRARY>` target properties.
``WHOLE_ARCHIVE``
Force inclusion of all members of a static library. This feature is only
supported for the following platforms, with limitations as noted:
Force inclusion of all members of a static library when linked as a
dependency of consuming :ref:`Executables`, :ref:`Shared Libraries`,
and :ref:`Module Libraries`. This feature is only supported for the
following platforms, with limitations as noted:
* Linux.
* All BSD variants.
@@ -21,6 +23,14 @@
* Cygwin.
* MSYS.
.. note::
Since :ref:`Static Libraries` are archives and not linked binaries,
CMake records their link dependencies for transitive use when linking
consuming binaries. Therefore ``WHOLE_ARCHIVE`` does not cause a
static library's objects to be included in other static libraries.
Use :ref:`Object Libraries` for that.
``FRAMEWORK``
This option tells the linker to search for the specified framework using
the ``-framework`` linker option. It can only be used on Apple platforms,