summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libs/utils/qtcprocess.cpp13
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();