Genex: Don't segfault on $<FOO,>
Treat the comma as part of the identifier here. It will later not resolve to a generator expression and the user gets a proper error message.
This commit is contained in:
parent
07749e3705
commit
b581be0767
|
@ -88,7 +88,15 @@ void cmGeneratorExpressionParser::ParseGeneratorExpression(
|
||||||
while(this->it->TokenType != cmGeneratorExpressionToken::EndExpression
|
while(this->it->TokenType != cmGeneratorExpressionToken::EndExpression
|
||||||
&& this->it->TokenType != cmGeneratorExpressionToken::ColonSeparator)
|
&& this->it->TokenType != cmGeneratorExpressionToken::ColonSeparator)
|
||||||
{
|
{
|
||||||
this->ParseContent(identifier);
|
if (this->it->TokenType == cmGeneratorExpressionToken::CommaSeparator)
|
||||||
|
{
|
||||||
|
extendText(identifier, this->it);
|
||||||
|
++this->it;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->ParseContent(identifier);
|
||||||
|
}
|
||||||
if (this->it == this->Tokens.end())
|
if (this->it == this->Tokens.end())
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -6,3 +6,12 @@ CMake Error at BadZero.cmake:2 \(add_custom_target\):
|
||||||
\$<0> expression requires a parameter.
|
\$<0> expression requires a parameter.
|
||||||
Call Stack \(most recent call first\):
|
Call Stack \(most recent call first\):
|
||||||
CMakeLists.txt:3 \(include\)
|
CMakeLists.txt:3 \(include\)
|
||||||
|
+
|
||||||
|
CMake Error at BadZero.cmake:2 \(add_custom_target\):
|
||||||
|
Error evaluating generator expression:
|
||||||
|
|
||||||
|
\$<0,>
|
||||||
|
|
||||||
|
Expression did not evaluate to a known generator expression
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
CMakeLists.txt:3 \(include\)
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
|
|
||||||
add_custom_target(check ALL COMMAND check
|
add_custom_target(check ALL COMMAND check
|
||||||
$<0>
|
$<0>
|
||||||
|
$<0,>
|
||||||
VERBATIM)
|
VERBATIM)
|
||||||
|
|
Loading…
Reference in New Issue