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: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
Oswald Buddenhagen
2012-08-28 18:27:28 +02:00
parent e513ee1bb0
commit 93b8270bd9
5 changed files with 9 additions and 6 deletions

View File

@@ -5,3 +5,4 @@ DEFINES *= QMAKE_AS_LIBRARY
DEFINES *= PROPARSER_THREAD_SAFE DEFINES *= PROPARSER_THREAD_SAFE
DEFINES *= PROEVALUATOR_THREAD_SAFE DEFINES *= PROEVALUATOR_THREAD_SAFE
DEFINES *= PROEVALUATOR_CUMULATIVE DEFINES *= PROEVALUATOR_CUMULATIVE
DEFINES *= PROEVALUATOR_SETENV

View File

@@ -12,7 +12,7 @@ include(../../qtcreatorplugin.pri)
include(qtsupport_dependencies.pri) include(qtsupport_dependencies.pri)
DEFINES += \ DEFINES += \
QMAKE_AS_LIBRARY QMAKE_LIBRARY \ 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) include(../../shared/proparser/proparser.pri)
HEADERS += \ HEADERS += \

View File

@@ -319,8 +319,10 @@ QMakeEvaluator::writeFile(const QString &ctx, const QString &fn, QIODevice::Open
void QMakeEvaluator::runProcess(QProcess *proc, const QString &command) const void QMakeEvaluator::runProcess(QProcess *proc, const QString &command) const
{ {
proc->setWorkingDirectory(currentDirectory()); proc->setWorkingDirectory(currentDirectory());
# ifdef PROEVALUATOR_SETENV
if (!m_option->environment.isEmpty()) if (!m_option->environment.isEmpty())
proc->setProcessEnvironment(m_option->environment); proc->setProcessEnvironment(m_option->environment);
# endif
# ifdef Q_OS_WIN # ifdef Q_OS_WIN
proc->setNativeArguments(QLatin1String("/v:off /s /c \"") + command + QLatin1Char('"')); proc->setNativeArguments(QLatin1String("/v:off /s /c \"") + command + QLatin1Char('"'));
proc->start(m_option->getEnv(QLatin1String("COMSPEC")), QStringList()); proc->start(m_option->getEnv(QLatin1String("COMSPEC")), QStringList());

View File

@@ -250,11 +250,11 @@ void QMakeGlobals::setDirectories(const QString &input_dir, const QString &outpu
QString QMakeGlobals::getEnv(const QString &var) const QString QMakeGlobals::getEnv(const QString &var) const
{ {
#ifndef QT_BOOTSTRAPPED #ifdef PROEVALUATOR_SETENV
if (!environment.isEmpty()) return environment.value(var);
return environment.value(var); #else
#endif
return QString::fromLocal8Bit(qgetenv(var.toLocal8Bit().constData())); return QString::fromLocal8Bit(qgetenv(var.toLocal8Bit().constData()));
#endif
} }
QStringList QMakeGlobals::getPathListEnv(const QString &var) const QStringList QMakeGlobals::getPathListEnv(const QString &var) const

View File

@@ -100,7 +100,7 @@ public:
QString dir_sep; QString dir_sep;
QString dirlist_sep; QString dirlist_sep;
QString cachefile; QString cachefile;
#ifndef QT_BOOTSTRAPPED #ifdef PROEVALUATOR_SETENV
QProcessEnvironment environment; QProcessEnvironment environment;
#endif #endif
QString qmake_abslocation; QString qmake_abslocation;