Help: Grammar, typos and wording improvements for linker variables

This commit is contained in:
Craig Scott 2024-03-26 08:02:46 +11:00
parent 5b21897c6e
commit aecea7b28b
No known key found for this signature in database
GPG Key ID: 6FF37CBDCCADED9F
5 changed files with 24 additions and 27 deletions

View File

@ -6,16 +6,13 @@ CMAKE_<LANG>_COMPILER_LINKER_FRONTEND_VARIANT
Identification string of the linker frontend variant.
Some linkers have multiple, different frontends for accepting command
line options. (For example ``LLCM LLD`` originally only had a frontend
compatible with the ``GNU`` compiler but since its port to Windows
(``lld-link``) it now also supports a frontend compatible with ``MSVC``.)
When CMake detects such a linker it sets this variable to what would have been
line options. For example, ``LLVM LLD`` originally only had a frontend
compatible with the ``GNU`` compiler, but since its port to Windows
(``lld-link``), it now also supports a frontend compatible with ``MSVC``.
When CMake detects such a linker, it sets this variable to what would have been
the :variable:`CMAKE_<LANG>_COMPILER_LINKER_ID` for the linker whose frontend
it resembles.
.. note::
In other words, this variable describes what command line options
and language extensions the linker frontend expects.
This variable is set for ``GNU``, ``MSVC``, ``MOLD`` and ``AppleClang``
linkers that have only one frontend variant.

View File

@ -17,8 +17,8 @@ Value Name
``bfd``)
``GNUgold`` `GNU Binutils - gold linker`_
``MSVC`` `Microsoft Visual Studio`_
``MOLD`` `mold: A Modern Linker`_ or, on Apple, `sold`_
linker
``MOLD`` `mold: A Modern Linker`_, or on Apple the
`sold`_ linker
``AIX`` AIX system linker
``Solaris`` SunOS system linker
=============================== ===============================================

View File

@ -3,8 +3,8 @@ CMAKE_<LANG>_USING_LINKER_MODE
.. versionadded:: 3.29
This variable specify what is the type of data stored in variable
:variable:`CMAKE_<LANG>_USING_LINKER_<TYPE>`. There are two possible values:
This controls how the value of the :variable:`CMAKE_<LANG>_USING_LINKER_<TYPE>`
variable should be interpreted. The supported linker mode values are:
``FLAG``
:variable:`CMAKE_<LANG>_USING_LINKER_<TYPE>` holds compiler flags. This is

View File

@ -3,32 +3,32 @@ CMAKE_<LANG>_USING_LINKER_<TYPE>
.. versionadded:: 3.29
This variable defines how to specify the linker for the link step for the type
as specified by the variable :variable:`CMAKE_LINKER_TYPE` or the target
property :prop_tgt:`LINKER_TYPE`. It can hold compiler flags for the link step
or directly the linker tool. The type of data is given by the variable
:variable:`CMAKE_<LANG>_USING_LINKER_MODE`.
This variable defines how to specify the ``<TYPE>`` linker for the link step,
as controlled by the :variable:`CMAKE_LINKER_TYPE` variable or the
:prop_tgt:`LINKER_TYPE` target property. Depending on the value of the
:variable:`CMAKE_<LANG>_USING_LINKER_MODE` variable,
``CMAKE_<LANG>_USING_LINKER_<TYPE>`` can hold compiler flags for the link step,
or flags to be given directly to the linker tool.
.. note::
The specified linker tool is expected to be accessible through
the ``PATH`` environment variable, particularly when the
:variable:`CMAKE_<LANG>_USING_LINKER_MODE` variable is set to ``FLAG``.
The specified linker tool is generally expected to be accessible through
the ``PATH`` environment variable.
For example, to specify the ``LLVM`` linker for ``GNU`` compilers, we have:
For example, the ``LLD`` linker for ``GNU`` compilers is defined like so:
.. code-block:: cmake
set(CMAKE_C_USING_LINKER_LLD "-fuse-ld=lld")
Or on ``Windows`` platform, for ``Clang`` compilers simulating ``MSVC``, we
have:
On the ``Windows`` platform with ``Clang`` compilers simulating ``MSVC``:
.. code-block:: cmake
set(CMAKE_C_USING_LINKER_LLD "-fuse-ld=lld-link")
And for the ``MSVC`` compiler, linker is directly used, so we have:
And for the ``MSVC`` compiler, the linker is invoked directly, not via the
compiler frontend:
.. code-block:: cmake

View File

@ -9,10 +9,10 @@ Specify which linker will be used for the link step.
It is assumed that the linker specified is fully compatible with the standard
one. CMake will not do any options translation.
This variable is used to initialize the :prop_tgt:`LINKER_TYPE` target
property when they are created by calls to :command:`add_library` or
:command:`add_executable` commands. It is meaningful only for targets having a
link step. If set, its value is also used by the :command:`try_compile`
This variable is used to initialize the :prop_tgt:`LINKER_TYPE` property
on each target created by a call to :command:`add_library` or
:command:`add_executable`. It is meaningful only for targets having a
link step. If set, its value is also used by the :command:`try_compile`
command.
.. include:: LINKER_PREDEFINED_TYPES.txt