Xcode: Quote variable names with invalid characters in them

Allows us to have scoped variables such as eg FOO[arch=armv7].

We could quote all variables, but Xcode doesn't, and we try to stay
close to the native behavior.

Change-Id: Ia6634a33e42031fe7e69c4f680803fa347e5de4a
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
This commit is contained in:
Tor Arne Vestbø 2013-09-23 16:01:43 +02:00 committed by The Qt Project
parent e8af66f906
commit 2ff3cbbb56

View File

@ -1804,7 +1804,10 @@ ProjectBuilderMakefileGenerator::writeSettings(const QString &var, const ProStri
for(int i = 0; i < indent_level; ++i) for(int i = 0; i < indent_level; ++i)
newline += "\t"; newline += "\t";
ret += var + " = "; static QRegExp allowedVariableCharacters("^[a-zA-Z0-9_]*$");
ret += var.contains(allowedVariableCharacters) ? var : quotedStringLiteral(var);
ret += " = ";
if(flags & SettingsAsList) { if(flags & SettingsAsList) {
ret += "(" + newline; ret += "(" + newline;