summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
Diffstat (limited to 'Help')
-rw-r--r--Help/command/DEVICE_LINK_OPTIONS.txt10
-rw-r--r--Help/command/add_link_options.rst2
-rw-r--r--Help/command/target_link_options.rst2
-rw-r--r--Help/manual/cmake-generator-expressions.7.rst12
-rw-r--r--Help/manual/cmake-policies.7.rst1
-rw-r--r--Help/policy/CMP0105.rst19
-rw-r--r--Help/prop_dir/LINK_OPTIONS.rst2
-rw-r--r--Help/prop_tgt/LINK_OPTIONS.rst12
-rw-r--r--Help/release/dev/device-link-options.rst5
-rw-r--r--Help/release/dev/genex-DEVICE_LINK-HOST_LINK.rst6
10 files changed, 66 insertions, 5 deletions
diff --git a/Help/command/DEVICE_LINK_OPTIONS.txt b/Help/command/DEVICE_LINK_OPTIONS.txt
new file mode 100644
index 0000000..012e9b1
--- /dev/null
+++ b/Help/command/DEVICE_LINK_OPTIONS.txt
@@ -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.
diff --git a/Help/command/add_link_options.rst b/Help/command/add_link_options.rst
index a83005b..faa4afb 100644
--- a/Help/command/add_link_options.rst
+++ b/Help/command/add_link_options.rst
@@ -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
diff --git a/Help/command/target_link_options.rst b/Help/command/target_link_options.rst
index b5abbc4..89038e3 100644
--- a/Help/command/target_link_options.rst
+++ b/Help/command/target_link_options.rst
@@ -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
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index 72de4ac..9e411a4 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -362,6 +362,18 @@ Variable Queries
evaluation will give ``C`` as link language, so the second pass will
correctly add target ``libother`` as link dependency.
+``$<DEVICE_LINK:list>``
+ Returns the list if it is the device link step, an empty list otherwise.
+ The device link step is controlled by :prop_tgt:`CUDA_SEPARABLE_COMPILATION`
+ and :prop_tgt:`CUDA_RESOLVE_DEVICE_SYMBOLS` properties. This expression can
+ only be used to specify link options.
+
+``$<HOST_LINK:list>``
+ Returns the list if it is the normal link step, an empty list otherwise.
+ This expression is mainly useful when a device link step is also involved
+ (see ``$<DEVICE_LINK:list>`` generator expression). This expression can only
+ be used to specify link options.
+
String-Valued Generator Expressions
===================================
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 869ae41..ffb4543 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -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>
diff --git a/Help/policy/CMP0105.rst b/Help/policy/CMP0105.rst
new file mode 100644
index 0000000..19a1edb
--- /dev/null
+++ b/Help/policy/CMP0105.rst
@@ -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
diff --git a/Help/prop_dir/LINK_OPTIONS.rst b/Help/prop_dir/LINK_OPTIONS.rst
index 54ac6dd..f229ba6 100644
--- a/Help/prop_dir/LINK_OPTIONS.rst
+++ b/Help/prop_dir/LINK_OPTIONS.rst
@@ -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.
diff --git a/Help/prop_tgt/LINK_OPTIONS.rst b/Help/prop_tgt/LINK_OPTIONS.rst
index 2a05ea7..ff3ee87 100644
--- a/Help/prop_tgt/LINK_OPTIONS.rst
+++ b/Help/prop_tgt/LINK_OPTIONS.rst
@@ -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
diff --git a/Help/release/dev/device-link-options.rst b/Help/release/dev/device-link-options.rst
new file mode 100644
index 0000000..f58026b
--- /dev/null
+++ b/Help/release/dev/device-link-options.rst
@@ -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`.
diff --git a/Help/release/dev/genex-DEVICE_LINK-HOST_LINK.rst b/Help/release/dev/genex-DEVICE_LINK-HOST_LINK.rst
new file mode 100644
index 0000000..ef275e7
--- /dev/null
+++ b/Help/release/dev/genex-DEVICE_LINK-HOST_LINK.rst
@@ -0,0 +1,6 @@
+genex-DEVICE_LINK-HOST_LINK
+---------------------------
+
+* To manage device and host link steps, the ``$<DEVICE_LINK:...>`` and
+ ``$<HOST_LINK:...>``
+ :manual:`generator expressions <cmake-generator-expressions(7)>` were added.