summaryrefslogtreecommitdiffstats
path: root/qmake/generators/win32
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2012-09-26 09:20:50 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-09-26 19:12:31 +0200
commit9e9911715c37511ece018aa9d36491b77872501b (patch)
tree009de66d64e46e7be372401e02dd366c0ebdc5e7 /qmake/generators/win32
parentebf0ee34e7a50b8dbe9ed766a9737a8f77805449 (diff)
qmake: fix overescaped defines in vcxproj files
Task-number: QTBUG-27345 Change-Id: I00848d611163afb549191f41adff628622a899e0 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'qmake/generators/win32')
-rw-r--r--qmake/generators/win32/msbuild_objectmodel.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp
index e691416a4a..27f67be525 100644
--- a/qmake/generators/win32/msbuild_objectmodel.cpp
+++ b/qmake/generators/win32/msbuild_objectmodel.cpp
@@ -324,6 +324,22 @@ static QString vcxCommandSeparator()
return cmdSep;
}
+static QString unquote(const QString &value)
+{
+ QString result = value;
+ result.replace(QStringLiteral("\\\""), QStringLiteral("\""));
+ return result;
+}
+
+static QStringList unquote(const QStringList &values)
+{
+ QStringList result;
+ result.reserve(values.size());
+ for (int i = values.count(); --i >= 0;)
+ result << unquote(values.at(i));
+ return result;
+}
+
// Tree file generation ---------------------------------------------
void XTreeNode::generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName, VCProject &tool, const QString &filter) {
@@ -1391,7 +1407,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCCLCompilerTool &tool)
<< attrTagS(_PrecompiledHeaderFile, tool.PrecompiledHeaderThrough)
<< attrTagS(_PrecompiledHeaderOutputFile, tool.PrecompiledHeaderFile)
<< attrTagT(_PreprocessKeepComments, tool.KeepComments)
- << attrTagX(_PreprocessorDefinitions, tool.PreprocessorDefinitions, ";")
+ << attrTagX(_PreprocessorDefinitions, unquote(tool.PreprocessorDefinitions), ";")
<< attrTagS(_PreprocessOutputPath, tool.PreprocessOutputPath)
<< attrTagT(_PreprocessSuppressLineNumbers, tool.PreprocessSuppressLineNumbers)
<< attrTagT(_PreprocessToFile, toTriState(tool.GeneratePreprocessedFile))
@@ -1526,7 +1542,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCMIDLTool &tool)
<< attrTagL(_LocaleID, tool.LocaleID, /*ifNot*/ -1)
<< attrTagT(_MkTypLibCompatible, tool.MkTypLibCompatible)
<< attrTagS(_OutputDirectory, tool.OutputDirectory)
- << attrTagX(_PreprocessorDefinitions, tool.PreprocessorDefinitions, ";")
+ << attrTagX(_PreprocessorDefinitions, unquote(tool.PreprocessorDefinitions), ";")
<< attrTagS(_ProxyFileName, tool.ProxyFileName)
<< attrTagS(_RedirectOutputAndErrors, tool.RedirectOutputAndErrors)
<< attrTagS(_ServerStubFile, tool.ServerStubFile)
@@ -1611,7 +1627,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCResourceCompilerTool &tool)
<< attrTagS(_Culture, toString(tool.Culture))
<< attrTagT(_IgnoreStandardIncludePath, tool.IgnoreStandardIncludePath)
//unused << attrTagT(_NullTerminateStrings, tool.NullTerminateStrings)
- << attrTagX(_PreprocessorDefinitions, tool.PreprocessorDefinitions, ";")
+ << attrTagX(_PreprocessorDefinitions, unquote(tool.PreprocessorDefinitions), ";")
<< attrTagS(_ResourceOutputFileName, tool.ResourceOutputFileName)
<< attrTagT(_ShowProgress, toTriState(tool.ShowProgress))
<< attrTagT(_SuppressStartupBanner, tool.SuppressStartupBanner)