summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2020-05-30 09:45:53 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2020-05-30 09:47:39 (GMT)
commit9436ad35df17df89e1a74f91103b04baad085127 (patch)
tree03dd545967151a213153304db2bafcdb3ce3987c /Help
parent67dd68765700bbd6a981700c04f45b28cdc85587 (diff)
downloadCMake-9436ad35df17df89e1a74f91103b04baad085127.zip
CMake-9436ad35df17df89e1a74f91103b04baad085127.tar.gz
CMake-9436ad35df17df89e1a74f91103b04baad085127.tar.bz2
target_link_libraries: self-link through ALIAS is an error
Fixes: #19617
Diffstat (limited to 'Help')
-rw-r--r--Help/manual/cmake-policies.7.rst1
-rw-r--r--Help/policy/CMP0108.rst19
-rw-r--r--Help/release/dev/self-link-through-alias.rst5
3 files changed, 25 insertions, 0 deletions
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 8d41ed8..e98038a 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
+ CMP0108: A target cannot link to itself through an alias. </policy/CMP0108>
CMP0107: An ALIAS target cannot overwrite another target. </policy/CMP0107>
CMP0106: The Documentation module is removed. </policy/CMP0106>
CMP0105: Device link step uses the link options. </policy/CMP0105>
diff --git a/Help/policy/CMP0108.rst b/Help/policy/CMP0108.rst
new file mode 100644
index 0000000..0d54cfa
--- /dev/null
+++ b/Help/policy/CMP0108.rst
@@ -0,0 +1,19 @@
+CMP0108
+-------
+
+A target is not allowed to link to itself even through an ``ALIAS`` target.
+
+In CMake 3.17 and below, a target can link to a target aliased to itself.
+
+The ``OLD`` behavior for this policy is to allow a target to link to a target
+aliased to itself.
+
+The ``NEW`` behavior of this policy is to prevent a target to link to itself
+through an ``ALIAS`` target.
+
+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/release/dev/self-link-through-alias.rst b/Help/release/dev/self-link-through-alias.rst
new file mode 100644
index 0000000..d91d7ae
--- /dev/null
+++ b/Help/release/dev/self-link-through-alias.rst
@@ -0,0 +1,5 @@
+self-link-through-alias
+-----------------------
+
+* Linking a target to itself through an alias now raise an error.
+ See policy :policy:`CMP0108`.