diff options
author | Daniel Teske <daniel.teske@nokia.com> | 2011-11-23 15:21:07 +0100 |
---|---|---|
committer | Daniel Teske <daniel.teske@nokia.com> | 2011-11-28 11:19:02 +0100 |
commit | fd19e94e3585339d5acd5c1d7d16622beee664ce (patch) | |
tree | 714fc1aaf56c10544ca13015d657d0b3c2095006 /src | |
parent | f709f4b0713a7796fd060bd04f2c4b5d735c48de (diff) | |
download | qt-creator-fd19e94e3585339d5acd5c1d7d16622beee664ce.tar.gz |
Set LD_LIBRARY_PATH/DYLD_LIBRARY_PATH to empty if not set at all
Work around qt being stupid.
Task-number: QTCREATORBUG-6583
Change-Id: I9443adea0b2be7e4d26d70ab817858d71fa1bbdb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/utils/qtcprocess.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libs/utils/qtcprocess.cpp b/src/libs/utils/qtcprocess.cpp index 3a3055afff..f6b4159b8d 100644 --- a/src/libs/utils/qtcprocess.cpp +++ b/src/libs/utils/qtcprocess.cpp @@ -657,6 +657,19 @@ void QtcProcess::start() if (m_environment.size() == 0) qWarning("QtcProcess::start: Empty environment set when running '%s'.", qPrintable(m_command)); env = m_environment; + + // If the process environemnt has no libraryPath, + // Qt will copy creator's libraryPath into the process environment. + // That's brain dead, and we work around it +#if defined(Q_OS_UNIX) +# if defined(Q_OS_MAC) + static const char libraryPath[] = "DYLD_LIBRARY_PATH"; +# else + static const char libraryPath[] = "LD_LIBRARY_PATH"; +# endif + if (env.constFind(libraryPath) == env.constEnd()) + env.set(libraryPath, QLatin1String("")); +#endif QProcess::setEnvironment(env.toStringList()); } else { env = Environment::systemEnvironment(); |