summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-03-06 19:21:38 (GMT)
committerBrad King <brad.king@kitware.com>2018-03-07 12:48:40 (GMT)
commit7723e9a058c579e3535df9bbe62ea218200e4250 (patch)
treea884f7554a019e372ef9862358a92bb60e4b7799 /Source/cmTarget.cxx
parent2124a1364a620084c24d5654c2106e5aea88c55c (diff)
downloadCMake-7723e9a058c579e3535df9bbe62ea218200e4250.zip
CMake-7723e9a058c579e3535df9bbe62ea218200e4250.tar.gz
CMake-7723e9a058c579e3535df9bbe62ea218200e4250.tar.bz2
Do not produce legacy _LIB_DEPENDS cache entries
Introduce policy `CMP0073` to avoid producing these cache entries. Fixes: #16364
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 97f7847..70387ae 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -737,7 +737,9 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, const std::string& lib,
// and we removing one instance will break the link line. Duplicates
// will be appropriately eliminated at emit time.
if (this->TargetTypeValue >= cmStateEnums::STATIC_LIBRARY &&
- this->TargetTypeValue <= cmStateEnums::MODULE_LIBRARY) {
+ this->TargetTypeValue <= cmStateEnums::MODULE_LIBRARY &&
+ (this->GetPolicyStatusCMP0073() == cmPolicies::OLD ||
+ this->GetPolicyStatusCMP0073() == cmPolicies::WARN)) {
std::string targetEntry = this->Name;
targetEntry += "_LIB_DEPENDS";
std::string dependencies;