LINK_OPTIONS_LINKER.txt 1000 B

12345678910111213141516171819202122
  1. To pass options to the linker tool, each compiler driver has is own syntax.
  2. The ``LINKER:`` prefix can be used to specify, in a portable way, options
  3. to pass to the linker tool. The ``LINKER:`` prefix is replaced by the required
  4. driver option and the rest of the option string defines linker arguments using
  5. ``,`` as separator. These arguments will be formatted according to the
  6. :variable:`CMAKE_<LANG>_LINKER_WRAPPER_FLAG` and
  7. :variable:`CMAKE_<LANG>_LINKER_WRAPPER_FLAG_SEP` variables.
  8. For example, ``"LINKER:-z,defs"`` becomes ``-Xlinker -z -Xlinker defs`` for
  9. ``Clang`` and ``-Wl,-z,defs`` for ``GNU GCC``.
  10. The ``LINKER:`` prefix can be specified as part of a ``SHELL:`` prefix
  11. expression.
  12. The ``LINKER:`` prefix supports, as alternate syntax, specification of
  13. arguments using ``SHELL:`` prefix and space as separator. Previous example
  14. becomes ``"LINKER:SHELL:-z defs"``.
  15. .. note::
  16. Specifying ``SHELL:`` prefix elsewhere than at the beginning of the
  17. ``LINKER:`` prefix is not supported.