Commit 7f9e9d22 authored by Tobias Hunger's avatar Tobias Hunger

Make PATH shorter

Make sure to not make PATH too long on windows: Windows can only handle
PATHes that are not too long.

Task-number: QTCREATORBUG-7844
Change-Id: I069d498c63e06a3164af5e36a8c757dfd0bcf75a
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
Reviewed-by: default avatarAndreas Holzammer <andreas.holzammer@kdab.com>
parent b4e605bf
......@@ -1197,10 +1197,15 @@ bool BaseQtVersion::queryQMakeVariables(const Utils::FileName &binary, QHash<QSt
Utils::Environment env = Utils::Environment::systemEnvironment();
#ifdef Q_OS_WIN
// Add tool chain environments. This is necessary for non-static qmakes e.g. using mingw on windows
// Add tool chain environment. This is necessary for non-static qmakes e.g. using mingw on windows
// We can not just add all the environments of all tool chains since that will make PATH too long
// which in turn will trigger a crash when parsing the results of vcvars.bat of MSVC.
QList<ProjectExplorer::Abi> abiList = ProjectExplorer::Abi::abisOfBinary(binary);
QList<ProjectExplorer::ToolChain *> tcList = ProjectExplorer::ToolChainManager::instance()->toolChains();
foreach (ProjectExplorer::ToolChain *tc, tcList)
tc->addToEnvironment(env);
foreach (ProjectExplorer::ToolChain *tc, tcList) {
if (abiList.contains(tc->targetAbi()))
tc->addToEnvironment(env);
}
#endif
process.setEnvironment(env.toStringList());
......
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