summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-06-14 14:25:29 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-06-24 14:22:15 (GMT)
commitff015ee11e66388f50f9a1350e2731e7a240ccb1 (patch)
tree9774652c1b86df3287def9599276c8827a1cd4e9 /Source
parentb58aff90c5a3633ae7fa0d78731433d40a02d8bd (diff)
downloadCMake-ff015ee11e66388f50f9a1350e2731e7a240ccb1.zip
CMake-ff015ee11e66388f50f9a1350e2731e7a240ccb1.tar.gz
CMake-ff015ee11e66388f50f9a1350e2731e7a240ccb1.tar.bz2
Genex: Report error if a target file is needed to evaluate link libraries.
Constructs such as target_link_libraries(foo $<$<STREQUAL:$<TARGET_FILE:foo>,foo.so>:bar>) segfault before this patch.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index cd0d26b..f57e683 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -1100,7 +1100,7 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
std::string Evaluate(const std::vector<std::string> &parameters,
cmGeneratorExpressionContext *context,
const GeneratorExpressionContent *content,
- cmGeneratorExpressionDAGChecker *) const
+ cmGeneratorExpressionDAGChecker *dagChecker) const
{
// Lookup the referenced target.
std::string name = *parameters.begin();
@@ -1125,6 +1125,13 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
"Target \"" + name + "\" is not an executable or library.");
return std::string();
}
+ if (dagChecker && dagChecker->EvaluatingLinkLibraries(name.c_str()))
+ {
+ ::reportError(context, content->GetOriginalExpression(),
+ "Expressions which require the linker language may not "
+ "be used while evaluating link libraries");
+ return std::string();
+ }
context->DependTargets.insert(target);
context->AllTargets.insert(target);