mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
Merge topic 'target_link_libraries-self-link-is-an-error'
9436ad35df target_link_libraries: self-link through ALIAS is an error
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4826
This commit is contained in:
@@ -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>
|
||||
|
||||
19
Help/policy/CMP0108.rst
Normal file
19
Help/policy/CMP0108.rst
Normal file
@@ -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
|
||||
5
Help/release/dev/self-link-through-alias.rst
Normal file
5
Help/release/dev/self-link-through-alias.rst
Normal file
@@ -0,0 +1,5 @@
|
||||
self-link-through-alias
|
||||
-----------------------
|
||||
|
||||
* Linking a target to itself through an alias now raise an error.
|
||||
See policy :policy:`CMP0108`.
|
||||
Reference in New Issue
Block a user