diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-08-06 09:19:56 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-09-09 19:08:34 (GMT) |
commit | f01dc72c582290390196f89593f32acf3e14b71f (patch) | |
tree | 4458987fc6fd508dd38b9ec3c7309349a7f14f24 /Source/cmTarget.cxx | |
parent | 1e11708a560f0d06867fb3f2a83149b224ef44ba (diff) | |
download | CMake-f01dc72c582290390196f89593f32acf3e14b71f.zip CMake-f01dc72c582290390196f89593f32acf3e14b71f.tar.gz CMake-f01dc72c582290390196f89593f32acf3e14b71f.tar.bz2 |
Use one authorative source of the LINK_LIBRARIES property.
We populate and maintain a vector of structs to keep track of
backtraces already, so no need to populate the Properties container
additionally.
For completeness, it is necessary to remove the condition for
populating the vector for only valid library names and generator
expressions. That condition is now determined when evaluating the
generator expressions.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 64 |
1 files changed, 46 insertions, 18 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 147c332..d18d2b8 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2657,6 +2657,11 @@ void cmTarget::FinalizeSystemIncludeDirectories() end = this->Internal->LinkInterfacePropertyEntries.end(); it != end; ++it) { + if (!cmGeneratorExpression::IsValidTargetName(it->Value) + && cmGeneratorExpression::Find(it->Value) == std::string::npos) + { + continue; + } { cmListFileBacktrace lfbt; cmGeneratorExpression ge(lfbt); @@ -3033,15 +3038,11 @@ void cmTarget::SetProperty(const char* prop, const char* value) if (strcmp(prop, "LINK_LIBRARIES") == 0) { this->Internal->LinkInterfacePropertyEntries.clear(); - if (cmGeneratorExpression::IsValidTargetName(value) - || cmGeneratorExpression::Find(value) != std::string::npos) - { - cmListFileBacktrace lfbt; - this->Makefile->GetBacktrace(lfbt); - cmValueWithOrigin entry(value, lfbt); - this->Internal->LinkInterfacePropertyEntries.push_back(entry); - } - // Fall through + cmListFileBacktrace lfbt; + this->Makefile->GetBacktrace(lfbt); + cmValueWithOrigin entry(value, lfbt); + this->Internal->LinkInterfacePropertyEntries.push_back(entry); + return; } this->Properties.SetProperty(prop, value, cmProperty::TARGET); this->MaybeInvalidatePropertyCache(prop); @@ -3099,15 +3100,11 @@ void cmTarget::AppendProperty(const char* prop, const char* value, } if (strcmp(prop, "LINK_LIBRARIES") == 0) { - if (cmGeneratorExpression::IsValidTargetName(value) - || cmGeneratorExpression::Find(value) != std::string::npos) - { - cmListFileBacktrace lfbt; - this->Makefile->GetBacktrace(lfbt); - cmValueWithOrigin entry(value, lfbt); - this->Internal->LinkInterfacePropertyEntries.push_back(entry); - } - // Fall through + cmListFileBacktrace lfbt; + this->Makefile->GetBacktrace(lfbt); + cmValueWithOrigin entry(value, lfbt); + this->Internal->LinkInterfacePropertyEntries.push_back(entry); + return; } this->Properties.AppendProperty(prop, value, cmProperty::TARGET, asString); this->MaybeInvalidatePropertyCache(prop); @@ -3387,6 +3384,11 @@ std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config) end = this->Internal->LinkInterfacePropertyEntries.end(); it != end; ++it) { + if (!cmGeneratorExpression::IsValidTargetName(it->Value) + && cmGeneratorExpression::Find(it->Value) == std::string::npos) + { + continue; + } { cmGeneratorExpression ge(lfbt); cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = @@ -3585,6 +3587,11 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result, end = this->Internal->LinkInterfacePropertyEntries.end(); it != end; ++it) { + if (!cmGeneratorExpression::IsValidTargetName(it->Value) + && cmGeneratorExpression::Find(it->Value) == std::string::npos) + { + continue; + } { cmGeneratorExpression ge(lfbt); cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = @@ -3693,6 +3700,11 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list, end = this->Internal->LinkInterfacePropertyEntries.end(); it != end; ++it) { + if (!cmGeneratorExpression::IsValidTargetName(it->Value) + && cmGeneratorExpression::Find(it->Value) == std::string::npos) + { + continue; + } { cmGeneratorExpression ge(lfbt); cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = @@ -4181,6 +4193,22 @@ const char *cmTarget::GetProperty(const char* prop, } return output.c_str(); } + if(strcmp(prop,"LINK_LIBRARIES") == 0) + { + static std::string output; + output = ""; + std::string sep; + for (std::vector<cmValueWithOrigin>::const_iterator + it = this->Internal->LinkInterfacePropertyEntries.begin(), + end = this->Internal->LinkInterfacePropertyEntries.end(); + it != end; ++it) + { + output += sep; + output += it->Value; + sep = ";"; + } + return output.c_str(); + } if (strcmp(prop,"IMPORTED") == 0) { |