ProjectExplorer: fix msvc toolchain detection for Windows SDK 7.x

Cancel processing the environment diff only if the setenv scripts return
a non zero exit code. Just checking the presence of standard error
output seems to be a to aggressive error checking in this case.

Task-number: QTCREATORBUG-18328
Change-Id: I9243932cd5721cfbfec5a980a2fab6e69f4c31c7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2018-07-24 14:02:01 +02:00
parent d1b77f2c79
commit 8fb73bb278

View File

@@ -367,16 +367,12 @@ Utils::optional<QString> AbstractMsvcToolChain::generateEnvironmentSettings(cons
run.setCodec(QTextCodec::codecForName("UTF-8")); run.setCodec(QTextCodec::codecForName("UTF-8"));
Utils::SynchronousProcessResponse response = run.runBlocking(cmdPath.toString(), cmdArguments); Utils::SynchronousProcessResponse response = run.runBlocking(cmdPath.toString(), cmdArguments);
QString command = QDir::toNativeSeparators(batchFile);
if (!response.stdErr().isEmpty()) {
return QCoreApplication::translate("ProjectExplorer::Internal::AbstractMsvcToolChain",
"Failed to retrieve MSVC Environment from \"%1\":\n"
"%2").arg(command, response.stdErr());
}
if (response.result != Utils::SynchronousProcessResponse::Finished) { if (response.result != Utils::SynchronousProcessResponse::Finished) {
const QString message = response.exitMessage(cmdPath.toString(), 10); const QString message = !response.stdErr().isEmpty()
? response.stdErr()
: response.exitMessage(cmdPath.toString(), 10);
qWarning().noquote() << message; qWarning().noquote() << message;
QString command = QDir::toNativeSeparators(batchFile);
if (!batchArgs.isEmpty()) if (!batchArgs.isEmpty())
command += ' ' + batchArgs; command += ' ' + batchArgs;
return QCoreApplication::translate("ProjectExplorer::Internal::AbstractMsvcToolChain", return QCoreApplication::translate("ProjectExplorer::Internal::AbstractMsvcToolChain",