summaryrefslogtreecommitdiffstats
path: root/qmake/generators
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2014-11-17 20:55:33 +0100
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-02-05 14:26:54 +0000
commit009df82f1ada7c934931efab2950f4bf356c90a6 (patch)
tree85a7163183f3f1fa2e6db238ebcded359cdb21bb /qmake/generators
parenta06f37c075d1d411d452e9ebcad83a6a3ccdcb42 (diff)
make quoting in the prl writer more robust
Change-Id: Idd9f64ac608b7e4ed840d5d9925bf741e03d78ab Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'qmake/generators')
-rw-r--r--qmake/generators/makefile.cpp35
1 files changed, 25 insertions, 10 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 088756688e..30b3ad1642 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -950,6 +950,21 @@ MakefileGenerator::processPrlFiles()
qFatal("MakefileGenerator::processPrlFiles() called!");
}
+static QString
+qv(const ProString &val)
+{
+ return ' ' + QMakeEvaluator::quoteValue(val);
+}
+
+static QString
+qv(const ProStringList &val)
+{
+ QString ret;
+ foreach (const ProString &v, val)
+ ret += qv(v);
+ return ret;
+}
+
void
MakefileGenerator::writePrlFile(QTextStream &t)
{
@@ -960,21 +975,21 @@ MakefileGenerator::writePrlFile(QTextStream &t)
QString bdir = Option::output_dir;
if(bdir.isEmpty())
bdir = qmake_getpwd();
- t << "QMAKE_PRL_BUILD_DIR = " << bdir << endl;
+ t << "QMAKE_PRL_BUILD_DIR =" << qv(bdir) << endl;
- t << "QMAKE_PRO_INPUT = " << project->projectFile().section('/', -1) << endl;
+ t << "QMAKE_PRO_INPUT =" << qv(project->projectFile().section('/', -1)) << endl;
if(!project->isEmpty("QMAKE_ABSOLUTE_SOURCE_PATH"))
- t << "QMAKE_PRL_SOURCE_DIR = " << project->first("QMAKE_ABSOLUTE_SOURCE_PATH") << endl;
- t << "QMAKE_PRL_TARGET = " << target << endl;
+ t << "QMAKE_PRL_SOURCE_DIR =" << qv(project->first("QMAKE_ABSOLUTE_SOURCE_PATH")) << endl;
+ t << "QMAKE_PRL_TARGET =" << qv(target) << endl;
if(!project->isEmpty("PRL_EXPORT_DEFINES"))
- t << "QMAKE_PRL_DEFINES = " << project->values("PRL_EXPORT_DEFINES").join(' ') << endl;
+ t << "QMAKE_PRL_DEFINES =" << qv(project->values("PRL_EXPORT_DEFINES")) << endl;
if(!project->isEmpty("PRL_EXPORT_CFLAGS"))
- t << "QMAKE_PRL_CFLAGS = " << project->values("PRL_EXPORT_CFLAGS").join(' ') << endl;
+ t << "QMAKE_PRL_CFLAGS =" << qv(project->values("PRL_EXPORT_CFLAGS")) << endl;
if(!project->isEmpty("PRL_EXPORT_CXXFLAGS"))
- t << "QMAKE_PRL_CXXFLAGS = " << project->values("PRL_EXPORT_CXXFLAGS").join(' ') << endl;
+ t << "QMAKE_PRL_CXXFLAGS =" << qv(project->values("PRL_EXPORT_CXXFLAGS")) << endl;
if(!project->isEmpty("CONFIG"))
- t << "QMAKE_PRL_CONFIG = " << project->values("CONFIG").join(' ') << endl;
+ t << "QMAKE_PRL_CONFIG =" << qv(project->values("CONFIG")) << endl;
if(!project->isEmpty("TARGET_VERSION_EXT"))
t << "QMAKE_PRL_VERSION = " << project->first("TARGET_VERSION_EXT") << endl;
else if(!project->isEmpty("VERSION"))
@@ -987,9 +1002,9 @@ MakefileGenerator::writePrlFile(QTextStream &t)
libs << "QMAKE_LIBS"; //obvious one
if(project->isActiveConfig("staticlib"))
libs << "QMAKE_LIBS_PRIVATE";
- t << "QMAKE_PRL_LIBS = ";
+ t << "QMAKE_PRL_LIBS =";
for (ProStringList::Iterator it = libs.begin(); it != libs.end(); ++it)
- t << project->values((*it).toKey()).join(' ').replace('\\', "\\\\") << " ";
+ t << qv(project->values((*it).toKey()));
t << endl;
}
}