From 8fb73bb27817a584ad1b7861da9228c6e22bf193 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Tue, 24 Jul 2018 14:02:01 +0200 Subject: [PATCH] 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 --- .../projectexplorer/abstractmsvctoolchain.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/plugins/projectexplorer/abstractmsvctoolchain.cpp b/src/plugins/projectexplorer/abstractmsvctoolchain.cpp index c47c0b43075..195f430d703 100644 --- a/src/plugins/projectexplorer/abstractmsvctoolchain.cpp +++ b/src/plugins/projectexplorer/abstractmsvctoolchain.cpp @@ -367,16 +367,12 @@ Utils::optional AbstractMsvcToolChain::generateEnvironmentSettings(cons run.setCodec(QTextCodec::codecForName("UTF-8")); 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) { - const QString message = response.exitMessage(cmdPath.toString(), 10); + const QString message = !response.stdErr().isEmpty() + ? response.stdErr() + : response.exitMessage(cmdPath.toString(), 10); qWarning().noquote() << message; + QString command = QDir::toNativeSeparators(batchFile); if (!batchArgs.isEmpty()) command += ' ' + batchArgs; return QCoreApplication::translate("ProjectExplorer::Internal::AbstractMsvcToolChain",