Commit 93b8270b authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

make use of real environment a separate option



only creator needs to set an own environment - the testreader, lupdate
and qmake don't.

Change-Id: I4ff561a3008d423969a3f331bdc5d16b281a020b
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent e513ee1b
......@@ -5,3 +5,4 @@ DEFINES *= QMAKE_AS_LIBRARY
DEFINES *= PROPARSER_THREAD_SAFE
DEFINES *= PROEVALUATOR_THREAD_SAFE
DEFINES *= PROEVALUATOR_CUMULATIVE
DEFINES *= PROEVALUATOR_SETENV
......@@ -12,7 +12,7 @@ include(../../qtcreatorplugin.pri)
include(qtsupport_dependencies.pri)
DEFINES += \
QMAKE_AS_LIBRARY QMAKE_LIBRARY \
PROPARSER_THREAD_SAFE PROEVALUATOR_THREAD_SAFE PROEVALUATOR_CUMULATIVE
PROPARSER_THREAD_SAFE PROEVALUATOR_THREAD_SAFE PROEVALUATOR_CUMULATIVE PROEVALUATOR_SETENV
include(../../shared/proparser/proparser.pri)
HEADERS += \
......
......@@ -319,8 +319,10 @@ QMakeEvaluator::writeFile(const QString &ctx, const QString &fn, QIODevice::Open
void QMakeEvaluator::runProcess(QProcess *proc, const QString &command) const
{
proc->setWorkingDirectory(currentDirectory());
# ifdef PROEVALUATOR_SETENV
if (!m_option->environment.isEmpty())
proc->setProcessEnvironment(m_option->environment);
# endif
# ifdef Q_OS_WIN
proc->setNativeArguments(QLatin1String("/v:off /s /c \"") + command + QLatin1Char('"'));
proc->start(m_option->getEnv(QLatin1String("COMSPEC")), QStringList());
......
......@@ -250,11 +250,11 @@ void QMakeGlobals::setDirectories(const QString &input_dir, const QString &outpu
QString QMakeGlobals::getEnv(const QString &var) const
{
#ifndef QT_BOOTSTRAPPED
if (!environment.isEmpty())
return environment.value(var);
#endif
#ifdef PROEVALUATOR_SETENV
return environment.value(var);
#else
return QString::fromLocal8Bit(qgetenv(var.toLocal8Bit().constData()));
#endif
}
QStringList QMakeGlobals::getPathListEnv(const QString &var) const
......
......@@ -100,7 +100,7 @@ public:
QString dir_sep;
QString dirlist_sep;
QString cachefile;
#ifndef QT_BOOTSTRAPPED
#ifdef PROEVALUATOR_SETENV
QProcessEnvironment environment;
#endif
QString qmake_abslocation;
......
Markdown is supported
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