summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-10-26 14:28:02 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-10-26 14:28:02 (GMT)
commit1b21ac405f7c0fecff26abac05423adeb281c6c1 (patch)
tree9508b478af457be4cf0664c08fde3d65eeae3a82 /Source
parent564cf169e6edfe54ee3b558cf86c2a15936430d3 (diff)
parent239b0c6b0ed821fd012a2a980961b9a9d43793e5 (diff)
downloadCMake-1b21ac405f7c0fecff26abac05423adeb281c6c1.zip
CMake-1b21ac405f7c0fecff26abac05423adeb281c6c1.tar.gz
CMake-1b21ac405f7c0fecff26abac05423adeb281c6c1.tar.bz2
Merge topic 'fix-tll-static-private'
239b0c6 Don't add invalid content to static lib INTERFACE_LINK_LIBRARIES.
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 ad4ae0c..2d7f720 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -985,15 +985,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 0707c62..9add198 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -395,10 +395,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.