diff options
author | Brad King <brad.king@kitware.com> | 2020-06-02 11:53:34 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-06-02 11:53:40 (GMT) |
commit | 855a7158ed5455f91892d408c4cdbf49e1b232cc (patch) | |
tree | 9a1cf511fd9b619e43b3d31599aa87445982d1ca /Help | |
parent | 1b0b0c6427f5defe6dc8ede404f36d190276652a (diff) | |
parent | 9436ad35df17df89e1a74f91103b04baad085127 (diff) | |
download | CMake-855a7158ed5455f91892d408c4cdbf49e1b232cc.zip CMake-855a7158ed5455f91892d408c4cdbf49e1b232cc.tar.gz CMake-855a7158ed5455f91892d408c4cdbf49e1b232cc.tar.bz2 |
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
Diffstat (limited to 'Help')
-rw-r--r-- | Help/manual/cmake-policies.7.rst | 1 | ||||
-rw-r--r-- | Help/policy/CMP0108.rst | 19 | ||||
-rw-r--r-- | Help/release/dev/self-link-through-alias.rst | 5 |
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`. |