summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/cmTarget.cxx15
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx11
2 files changed, 18 insertions, 8 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 9e2234e..779b239 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2331,15 +2331,20 @@ void cmTarget::MergeLinkLibraries( cmMakefile& mf,
i += this->PrevLinkedLibraries.size();
for( ; i != libs.end(); ++i )
{
+ const char *lib = i->first.c_str();
// We call this so that the dependencies get written to the cache
- this->AddLinkLibrary( mf, selfname, i->first.c_str(), i->second );
+ this->AddLinkLibrary( mf, selfname, lib, i->second );
if (this->GetType() == cmTarget::STATIC_LIBRARY)
{
- this->AppendProperty("INTERFACE_LINK_LIBRARIES",
- ("$<LINK_ONLY:" +
- this->GetDebugGeneratorExpressions(i->first.c_str(), i->second) +
- ">").c_str());
+ std::string configLib = this->GetDebugGeneratorExpressions(lib,
+ i->second);
+ if (cmGeneratorExpression::IsValidTargetName(lib)
+ || cmGeneratorExpression::Find(lib) != std::string::npos)
+ {
+ configLib = "$<LINK_ONLY:" + configLib + ">";
+ }
+ this->AppendProperty("INTERFACE_LINK_LIBRARIES", configLib.c_str());
}
}
this->PrevLinkedLibraries = libs;
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 863b391..6030a44 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -384,10 +384,15 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
{
if (this->Target->GetType() == cmTarget::STATIC_LIBRARY)
{
+ std::string configLib = this->Target
+ ->GetDebugGeneratorExpressions(lib, llt);
+ if (cmGeneratorExpression::IsValidTargetName(lib)
+ || cmGeneratorExpression::Find(lib) != std::string::npos)
+ {
+ configLib = "$<LINK_ONLY:" + configLib + ">";
+ }
this->Target->AppendProperty("INTERFACE_LINK_LIBRARIES",
- ("$<LINK_ONLY:" +
- this->Target->GetDebugGeneratorExpressions(lib, llt) +
- ">").c_str());
+ configLib.c_str());
}
// Not a 'public' or 'interface' library. Do not add to interface
// property.