Commit 2097e88a authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

When a variable is empty, resolve it as an empty argument

Doesn't have anything to do with the bug description but
it's what was going on there.

BUG: 290843
parent bdbcda24
......@@ -71,7 +71,9 @@ QString CMakeFunctionArgument::unescapeValue(const QString& value)
void CMakeFunctionDesc::addArguments( const QStringList& args )
{
foreach( const QString& arg, args )
if(args.isEmpty())
arguments += QString();
else foreach( const QString& arg, args )
{
CMakeFunctionArgument cmakeArg( arg );
arguments.append( cmakeArg );
......
......@@ -465,6 +465,10 @@ void CMakeProjectVisitorTest::testRun_data()
"set(X 123)\n"
"HOLA()\n"
<< cacheValues << results;
results.clear();
QTest::newRow("reducedemptyvars") <<
"string(REPLACE ${A} ${B} X ${A})\n"
<< cacheValues << results;
}
void CMakeProjectVisitorTest::testRun()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment