summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-07-22 16:02:40 (GMT)
committerBrad King <brad.king@kitware.com>2020-07-23 17:31:45 (GMT)
commit45158b2afef1dd3b4bd4accfcea07849921ba7df (patch)
tree6f0f196b32264d329576e38f83b483143bb0adaf /Source
parentd6b1f5704e9d22c371ac30c8b02a188a9d80e6cc (diff)
downloadCMake-45158b2afef1dd3b4bd4accfcea07849921ba7df.zip
CMake-45158b2afef1dd3b4bd4accfcea07849921ba7df.tar.gz
CMake-45158b2afef1dd3b4bd4accfcea07849921ba7df.tar.bz2
cmGeneratorTarget: Simplify logic in ComputeLinkInterfaceLibraries
Also check the result of `GetLinkImplementationLibrariesInternal` before using it.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGeneratorTarget.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 2284d68..30af139 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -6549,15 +6549,20 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries(
iface.HadHeadSensitiveCondition,
iface.HadContextSensitiveCondition,
iface.HadLinkLanguageSensitiveCondition);
- } else if (!cmp0022NEW)
+ return;
+ }
+
// 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
// to the link implementation.
- {
- // The link implementation is the default link interface.
- cmLinkImplementationLibraries const* impl =
- this->GetLinkImplementationLibrariesInternal(config, headTarget);
+ if (cmp0022NEW) {
+ return;
+ }
+
+ // The link implementation is the default link interface.
+ if (cmLinkImplementationLibraries const* impl =
+ this->GetLinkImplementationLibrariesInternal(config, headTarget)) {
iface.Libraries.insert(iface.Libraries.end(), impl->Libraries.begin(),
impl->Libraries.end());
if (this->GetPolicyStatusCMP0022() == cmPolicies::WARN &&