diff options
Diffstat (limited to 'src/lib/corelib/tools/msvcinfo.cpp')
-rw-r--r-- | src/lib/corelib/tools/msvcinfo.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/corelib/tools/msvcinfo.cpp b/src/lib/corelib/tools/msvcinfo.cpp index 418a76ba1..77b83023a 100644 --- a/src/lib/corelib/tools/msvcinfo.cpp +++ b/src/lib/corelib/tools/msvcinfo.cpp @@ -176,6 +176,7 @@ static QVariantMap getMsvcDefines(const QString &compilerFilePath, << qEnvironmentVariable("COMSPEC") << QStringLiteral("/c") << languageSwitch + << QStringLiteral("/Zs") << QStringLiteral("NUL"), compilerEnv, true, commands)).split(QLatin1Char('\n')); @@ -309,7 +310,7 @@ static QString vswhereFilePath() static const std::vector<const char *> envVarCandidates{"ProgramFiles", "ProgramFiles(x86)"}; for (const char * const envVar : envVarCandidates) { const QString value = QDir::fromNativeSeparators(QString::fromLocal8Bit(qgetenv(envVar))); - const QString cmd = value + QString cmd = value + QStringLiteral("/Microsoft Visual Studio/Installer/vswhere.exe"); if (QFileInfo(cmd).exists()) return cmd; @@ -356,8 +357,8 @@ static std::vector<MSVCInstallInfo> retrieveInstancesFromVSWhere( return result; } const auto jsonArray = jsonOutput.array(); - for (const QJsonValue &v : jsonArray) { - const QJsonObject o = v.toObject(); + for (const auto &value : jsonArray) { + const QJsonObject o = value.toObject(); MSVCInstallInfo info; info.version = o.value(QStringLiteral("installationVersion")).toString(); if (productType == ProductType::BuildTools) { @@ -509,7 +510,7 @@ void MSVC::init() QString MSVC::architectureFromClPath(const QString &clPath) { const auto parentDir = QFileInfo(clPath).absolutePath(); - const auto parentDirName = QFileInfo(parentDir).fileName().toLower(); + auto parentDirName = QFileInfo(parentDir).fileName().toLower(); // can be the case when cl.exe is present within the Windows SDK installation... but can it? if (parentDirName == QLatin1String("bin")) return QStringLiteral("x86"); @@ -722,7 +723,7 @@ QString MSVCInstallInfo::findVcvarsallBat() const std::vector<MSVCInstallInfo> MSVCInstallInfo::installedMSVCs(Logger &logger) { - const auto installInfos = installedMSVCsFromVsWhere(logger); + auto installInfos = installedMSVCsFromVsWhere(logger); if (installInfos.empty()) return installedMSVCsFromRegistry(); return installInfos; |