make quoting in the prl writer more robust
Change-Id: Idd9f64ac608b7e4ed840d5d9925bf741e03d78ab Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
parent
a06f37c075
commit
009df82f1a
@ -950,6 +950,21 @@ MakefileGenerator::processPrlFiles()
|
|||||||
qFatal("MakefileGenerator::processPrlFiles() called!");
|
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
|
void
|
||||||
MakefileGenerator::writePrlFile(QTextStream &t)
|
MakefileGenerator::writePrlFile(QTextStream &t)
|
||||||
{
|
{
|
||||||
@ -960,21 +975,21 @@ MakefileGenerator::writePrlFile(QTextStream &t)
|
|||||||
QString bdir = Option::output_dir;
|
QString bdir = Option::output_dir;
|
||||||
if(bdir.isEmpty())
|
if(bdir.isEmpty())
|
||||||
bdir = qmake_getpwd();
|
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"))
|
if(!project->isEmpty("QMAKE_ABSOLUTE_SOURCE_PATH"))
|
||||||
t << "QMAKE_PRL_SOURCE_DIR = " << project->first("QMAKE_ABSOLUTE_SOURCE_PATH") << endl;
|
t << "QMAKE_PRL_SOURCE_DIR =" << qv(project->first("QMAKE_ABSOLUTE_SOURCE_PATH")) << endl;
|
||||||
t << "QMAKE_PRL_TARGET = " << target << endl;
|
t << "QMAKE_PRL_TARGET =" << qv(target) << endl;
|
||||||
if(!project->isEmpty("PRL_EXPORT_DEFINES"))
|
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"))
|
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"))
|
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"))
|
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"))
|
if(!project->isEmpty("TARGET_VERSION_EXT"))
|
||||||
t << "QMAKE_PRL_VERSION = " << project->first("TARGET_VERSION_EXT") << endl;
|
t << "QMAKE_PRL_VERSION = " << project->first("TARGET_VERSION_EXT") << endl;
|
||||||
else if(!project->isEmpty("VERSION"))
|
else if(!project->isEmpty("VERSION"))
|
||||||
@ -987,9 +1002,9 @@ MakefileGenerator::writePrlFile(QTextStream &t)
|
|||||||
libs << "QMAKE_LIBS"; //obvious one
|
libs << "QMAKE_LIBS"; //obvious one
|
||||||
if(project->isActiveConfig("staticlib"))
|
if(project->isActiveConfig("staticlib"))
|
||||||
libs << "QMAKE_LIBS_PRIVATE";
|
libs << "QMAKE_LIBS_PRIVATE";
|
||||||
t << "QMAKE_PRL_LIBS = ";
|
t << "QMAKE_PRL_LIBS =";
|
||||||
for (ProStringList::Iterator it = libs.begin(); it != libs.end(); ++it)
|
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;
|
t << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -218,8 +218,8 @@ static QString windowsErrorCode()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static QString
|
QString
|
||||||
quoteValue(const ProString &val)
|
QMakeEvaluator::quoteValue(const ProString &val)
|
||||||
{
|
{
|
||||||
QString ret;
|
QString ret;
|
||||||
ret.reserve(val.size());
|
ret.reserve(val.size());
|
||||||
|
@ -254,6 +254,8 @@ public:
|
|||||||
enum { m_skipLevel = 0 };
|
enum { m_skipLevel = 0 };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static QString quoteValue(const ProString &val);
|
||||||
|
|
||||||
#ifdef PROEVALUATOR_DEBUG
|
#ifdef PROEVALUATOR_DEBUG
|
||||||
void debugMsgInternal(int level, const char *fmt, ...) const;
|
void debugMsgInternal(int level, const char *fmt, ...) const;
|
||||||
void traceMsgInternal(const char *fmt, ...) const;
|
void traceMsgInternal(const char *fmt, ...) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user