cmake/Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG.rst

40 lines
1.2 KiB
ReStructuredText
Raw Normal View History

2018-10-28 12:09:07 +01:00
CMAKE_<LANG>_LINKER_WRAPPER_FLAG
--------------------------------
Defines the syntax of compiler driver option to pass options to the linker
tool. It will be used to translate the ``LINKER:`` prefix in the link options
(see :command:`add_link_options` and :command:`target_link_options`).
2019-11-11 23:01:05 +01:00
This variable holds a :ref:`semicolon-separated list <CMake Language Lists>` of tokens.
2018-10-28 12:09:07 +01:00
If a space (i.e. " ") is specified as last token, flag and ``LINKER:``
arguments will be specified as separate arguments to the compiler driver.
The :variable:`CMAKE_<LANG>_LINKER_WRAPPER_FLAG_SEP` variable can be specified
to manage concatenation of arguments.
For example, for ``Clang`` we have:
.. code-block:: cmake
set (CMAKE_C_LINKER_WRAPPER_FLAG "-Xlinker" " ")
2018-11-29 20:27:00 +01:00
Specifying ``"LINKER:-z,defs"`` will be transformed in
2018-10-28 12:09:07 +01:00
``-Xlinker -z -Xlinker defs``.
For ``GNU GCC``:
.. code-block:: cmake
set (CMAKE_C_LINKER_WRAPPER_FLAG "-Wl,")
set (CMAKE_C_LINKER_WRAPPER_FLAG_SEP ",")
2018-11-29 20:27:00 +01:00
Specifying ``"LINKER:-z,defs"`` will be transformed in ``-Wl,-z,defs``.
2018-10-28 12:09:07 +01:00
And for ``SunPro``:
.. code-block:: cmake
set (CMAKE_C_LINKER_WRAPPER_FLAG "-Qoption" "ld" " ")
set (CMAKE_C_LINKER_WRAPPER_FLAG_SEP ",")
2018-11-29 20:27:00 +01:00
Specifying ``"LINKER:-z,defs"`` will be transformed in ``-Qoption ld -z,defs``.