LINK_OPTIONS.rst 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. LINK_OPTIONS
  2. ------------
  3. .. versionadded:: 3.13
  4. List of options to use for the link step of shared library, module
  5. and executable targets as well as the device link step. Targets that are static
  6. libraries need to use the :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property.
  7. These options are used for both normal linking and device linking
  8. (see policy :policy:`CMP0105`). To control link options for normal and device
  9. link steps, :genex:`$<HOST_LINK>` and :genex:`$<DEVICE_LINK>` generator
  10. expressions can be used.
  11. This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of
  12. options specified so far for its target. Use the :command:`target_link_options`
  13. command to append more options.
  14. This property is initialized by the :prop_dir:`LINK_OPTIONS` directory
  15. property when a target is created, and is used by the generators to set
  16. the options for the compiler.
  17. Contents of ``LINK_OPTIONS`` may use "generator expressions" with the
  18. syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual
  19. for available expressions. See the :manual:`cmake-buildsystem(7)` manual
  20. for more on defining buildsystem properties.
  21. .. note::
  22. This property must be used in preference to :prop_tgt:`LINK_FLAGS` property.
  23. .. include:: ../command/DEVICE_LINK_OPTIONS.txt
  24. .. include:: ../command/OPTIONS_SHELL.txt
  25. .. include:: ../command/LINK_OPTIONS_LINKER.txt