summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-03-06 16:15:57 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-03-06 16:42:08 (GMT)
commit254687d31f2f45b0d3ce9085c013ab0e15b360de (patch)
tree57549544c33ef55664482adac63fb4e324f5ece2
parentefdf152fe1582be3e39f3a16e0ddaeb386fe1c20 (diff)
downloadCMake-254687d31f2f45b0d3ce9085c013ab0e15b360de.zip
CMake-254687d31f2f45b0d3ce9085c013ab0e15b360de.tar.gz
CMake-254687d31f2f45b0d3ce9085c013ab0e15b360de.tar.bz2
Only process transitive interface properties for valid target names.
Commit a1c4905f (Use the link information as a source of compile definitions and includes., 2013-02-12) introduced the use of link information as the source of target properties via the TARGET_PROPERTY generator expression. This generator expression has a strict interpretation of a valid target name and emits a fatal error for invalid names. Ensure that only targets with names valid for use with TARGET_PROPERTY or targets which are determined by generator expressions are processed by it. This means that at worst, invalid target names do not participate in the transitive evaluation of properties, but the validation generator expression can be extended where needed to resolve that.
-rw-r--r--Source/cmTarget.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index f38b16e..d46325b 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2898,7 +2898,8 @@ std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config)
ge.Parse(it->Value);
std::string result = cge->Evaluate(this->Makefile, config,
false, this, 0, 0);
- if (!this->Makefile->FindTargetToUse(result.c_str()))
+ if (!cmGeneratorExpression::IsValidTargetName(result.c_str())
+ || !this->Makefile->FindTargetToUse(result.c_str()))
{
continue;
}
@@ -2975,7 +2976,9 @@ std::string cmTarget::GetCompileDefinitions(const char *config)
for (std::vector<std::string>::const_iterator it = libs.begin();
it != libs.end(); ++it)
{
- if (this->Makefile->FindTargetToUse(it->c_str()))
+ if ((cmGeneratorExpression::IsValidTargetName(it->c_str())
+ || cmGeneratorExpression::Find(it->c_str()) != std::string::npos)
+ && this->Makefile->FindTargetToUse(it->c_str()))
{
depString += sep + "$<TARGET_PROPERTY:"
+ *it + ",INTERFACE_COMPILE_DEFINITIONS>";