mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-21 21:58:50 -05:00
CUDA: Device linking use now link options
properties LINK_OPTIONS and INTERFACE_LINK_OPTIONS are propagated to the device link step. To control which options are selected for normal link and device link steps, the $<DEVICE_LINK> and $<HOST_LINK> generator expressions can be used. Fixes: #18265
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
|
||||
When a device link step is involved, which is controlled by
|
||||
:prop_tgt:`CUDA_SEPARABLE_COMPILATION` and
|
||||
:prop_tgt:`CUDA_RESOLVE_DEVICE_SYMBOLS` properties, the raw options will be
|
||||
delivered to the host and device link steps (wrapped in ``-Xcompiler`` or
|
||||
equivalent for device link). Options wrapped with ``$<DEVICE_LINK:...>``
|
||||
:manual:`generator expression <cmake-generator-expressions(7)>` will be used
|
||||
only for the device link step. Options wrapped with ``$<HOST_LINK:...>``
|
||||
:manual:`generator expression <cmake-generator-expressions(7)>` will be used
|
||||
only for the host link step.
|
||||
@@ -26,6 +26,8 @@ the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
|
||||
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
|
||||
manual for more on defining buildsystem properties.
|
||||
|
||||
.. include:: DEVICE_LINK_OPTIONS.txt
|
||||
|
||||
.. include:: OPTIONS_SHELL.txt
|
||||
|
||||
.. include:: LINK_OPTIONS_LINKER.txt
|
||||
|
||||
@@ -43,6 +43,8 @@ with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
|
||||
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
|
||||
manual for more on defining buildsystem properties.
|
||||
|
||||
.. include:: DEVICE_LINK_OPTIONS.txt
|
||||
|
||||
.. include:: OPTIONS_SHELL.txt
|
||||
|
||||
.. include:: LINK_OPTIONS_LINKER.txt
|
||||
|
||||
@@ -57,6 +57,7 @@ Policies Introduced by CMake 3.18
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
CMP0105: Device link step uses the link options. </policy/CMP0105>
|
||||
CMP0104: CMAKE_CUDA_ARCHITECTURES now detected for NVCC, empty CUDA_ARCHITECTURES not allowed. </policy/CMP0104>
|
||||
CMP0103: Multiple export() with same FILE without APPEND is not allowed. </policy/CMP0103>
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
CMP0105
|
||||
-------
|
||||
|
||||
:prop_tgt:`LINK_OPTIONS` and :prop_tgt:`INTERFACE_LINK_OPTIONS` target
|
||||
properties are now used for the device link step.
|
||||
|
||||
In CMake 3.17 and below, link options are not used by the device link step.
|
||||
|
||||
The ``OLD`` behavior for this policy is to ignore the link options.
|
||||
|
||||
The ``NEW`` behavior of this policy is to use the link options during the
|
||||
device link step.
|
||||
|
||||
This policy was introduced in CMake version 3.17. Use the
|
||||
:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
|
||||
Unlike many policies, CMake version |release| does *not* warn
|
||||
when this policy is not set and simply uses ``OLD`` behavior.
|
||||
|
||||
.. include:: DEPRECATED.txt
|
||||
@@ -2,7 +2,7 @@ LINK_OPTIONS
|
||||
------------
|
||||
|
||||
List of options to use for the link step of shared library, module
|
||||
and executable targets.
|
||||
and executable targets as well as the device link step.
|
||||
|
||||
This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of options
|
||||
given so far to the :command:`add_link_options` command.
|
||||
|
||||
@@ -2,12 +2,16 @@ LINK_OPTIONS
|
||||
------------
|
||||
|
||||
List of options to use for the link step of shared library, module
|
||||
and executable targets. Targets that are static libraries need to use
|
||||
the :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property.
|
||||
and executable targets as well as the device link step. Targets that are static
|
||||
libraries need to use the :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property.
|
||||
|
||||
These options are used for both normal linking and device linking
|
||||
(see policy :policy:`CMP0105`). To control link options for normal and device
|
||||
link steps, ``$<HOST_LINK>`` and ``$<DEVICE_LINK>``
|
||||
:manual:`generator expressions <cmake-generator-expressions(7)>` can be used.
|
||||
|
||||
This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of options
|
||||
specified so far for its target. Use the :command:`target_link_options`
|
||||
This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of
|
||||
options specified so far for its target. Use the :command:`target_link_options`
|
||||
command to append more options.
|
||||
|
||||
This property is initialized by the :prop_dir:`LINK_OPTIONS` directory
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
device-link-options
|
||||
-------------------
|
||||
|
||||
* the :prop_tgt:`LINK_OPTIONS` and :prop_tgt:`INTERFACE_LINK_OPTIONS` target
|
||||
properties are now used for the device link step. See policy :policy:`CMP0105`.
|
||||
Reference in New Issue
Block a user