forked from qt-creator/qt-creator
Add LIBS-paths to PATH before running on windows.
On windows when linking to a library via -L/some/path, the library is found in /some/path while linking. But running that app fails, since it can't find the library. We now adjust PATH to include all paths from LIBS and thus the library is found.
This commit is contained in:
@@ -550,6 +550,16 @@ ProjectExplorer::Environment Qt4RunConfiguration::baseEnvironment() const
|
||||
if (m_isUsingDyldImageSuffix) {
|
||||
env.set("DYLD_IMAGE_SUFFIX", "_debug");
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
// On windows the user could be linking to a library found via a -L/some/dir switch
|
||||
// to find those libraries while actually running we explicitly prepend those
|
||||
// dirs to the path
|
||||
Qt4ProFileNode *node = qt4Target()->qt4Project()->rootProjectNode()->findProFileFor(m_proFilePath);
|
||||
if (node)
|
||||
foreach(const QString dir, node->variableValue(LibDirectoriesVar))
|
||||
env.prependOrSetPath(dir);
|
||||
#endif
|
||||
return env;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user