summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-08-02 18:47:33 (GMT)
committerBrad King <brad.king@kitware.com>2019-08-02 18:48:34 (GMT)
commit4b2e1fc9eeeb0b0b686b2e38a2a29e49eedb45e5 (patch)
tree41801371b41bfcaaa706435c956035671f19257d /Source/cmGeneratorTarget.cxx
parent94648953befa6464e46469b1fa8d46b68d486321 (diff)
downloadCMake-4b2e1fc9eeeb0b0b686b2e38a2a29e49eedb45e5.zip
CMake-4b2e1fc9eeeb0b0b686b2e38a2a29e49eedb45e5.tar.gz
CMake-4b2e1fc9eeeb0b0b686b2e38a2a29e49eedb45e5.tar.bz2
cmGeneratorTarget: Use local var to de-duplicate CMP0022 checks
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 42683db..747051d 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -5603,8 +5603,9 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries(
// libraries and executables that export symbols.
const char* explicitLibraries = nullptr;
std::string linkIfaceProp;
- if (this->GetPolicyStatusCMP0022() != cmPolicies::OLD &&
- this->GetPolicyStatusCMP0022() != cmPolicies::WARN) {
+ bool const cmp0022NEW = (this->GetPolicyStatusCMP0022() != cmPolicies::OLD &&
+ this->GetPolicyStatusCMP0022() != cmPolicies::WARN);
+ if (cmp0022NEW) {
// CMP0022 NEW behavior is to use INTERFACE_LINK_LIBRARIES.
linkIfaceProp = "INTERFACE_LINK_LIBRARIES";
explicitLibraries = this->GetProperty(linkIfaceProp);
@@ -5666,8 +5667,7 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries(
this->ExpandLinkItems(linkIfaceProp, explicitLibraries, config, headTarget,
usage_requirements_only, iface.Libraries,
iface.HadHeadSensitiveCondition);
- } else if (this->GetPolicyStatusCMP0022() == cmPolicies::WARN ||
- this->GetPolicyStatusCMP0022() == cmPolicies::OLD)
+ } else if (!cmp0022NEW)
// If CMP0022 is NEW then the plain tll signature sets the
// INTERFACE_LINK_LIBRARIES, so if we get here then the project
// cleared the property explicitly and we should not fall back