From ec2c67bcf3aada9b601d5dca52b31a4fb6104240 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 18 Feb 2013 11:24:41 +0100 Subject: [PATCH] Strip stray semicolons when evaluating generator expressions. --- Source/cmGeneratorExpression.cxx | 7 ++++--- Source/cmGeneratorExpression.h | 1 + Source/cmGeneratorExpressionEvaluator.cxx | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index 5d162fe03..08ffe1dc7 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -153,7 +153,8 @@ cmCompiledGeneratorExpression::~cmCompiledGeneratorExpression() } //---------------------------------------------------------------------------- -static std::string stripEmptyListElements(const std::string &input) +std::string cmGeneratorExpression::StripEmptyListElements( + const std::string &input) { std::string result; @@ -223,7 +224,7 @@ static std::string stripAllGeneratorExpressions(const std::string &input) lastPos = pos; } result += input.substr(lastPos); - return stripEmptyListElements(result); + return cmGeneratorExpression::StripEmptyListElements(result); } //---------------------------------------------------------------------------- @@ -284,7 +285,7 @@ static std::string stripExportInterface(const std::string &input, } result += input.substr(lastPos); - return stripEmptyListElements(result); + return cmGeneratorExpression::StripEmptyListElements(result); } //---------------------------------------------------------------------------- diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h index 489b052e9..ca4157380 100644 --- a/Source/cmGeneratorExpression.h +++ b/Source/cmGeneratorExpression.h @@ -66,6 +66,7 @@ public: static bool IsValidTargetName(const std::string &input); + static std::string StripEmptyListElements(const std::string &input); private: cmGeneratorExpression(const cmGeneratorExpression &); void operator=(const cmGeneratorExpression &); diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index cd6a40b8d..023daf862 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -508,6 +508,9 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode } } + linkedTargetsContent = + cmGeneratorExpression::StripEmptyListElements(linkedTargetsContent); + if (!prop) { if (target->IsImported())