forked from qt-creator/qt-creator
Add better naming for (recent) Microsoft Visual C++ compiler
Fixes: QTCREATORBUG-31150 Change-Id: Id68107151898c95a621350d83a90539fca2cc1a8 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
committed by
Xavier BESSON (Personal)
parent
c7491b6ba4
commit
ccd2eb0e92
@@ -182,6 +182,7 @@ struct VisualStudioInstallation
|
|||||||
QString path; // Main installation path
|
QString path; // Main installation path
|
||||||
QString vcVarsPath; // Path under which the various vc..bat are to be found
|
QString vcVarsPath; // Path under which the various vc..bat are to be found
|
||||||
QString vcVarsAll;
|
QString vcVarsAll;
|
||||||
|
QString displayName;
|
||||||
};
|
};
|
||||||
|
|
||||||
QDebug operator<<(QDebug d, const VisualStudioInstallation &i)
|
QDebug operator<<(QDebug d, const VisualStudioInstallation &i)
|
||||||
@@ -305,8 +306,12 @@ static QVector<VisualStudioInstallation> detectVisualStudioFromVsWhere(const QSt
|
|||||||
std::optional<VisualStudioInstallation> installation
|
std::optional<VisualStudioInstallation> installation
|
||||||
= installationFromPathAndVersion(installationPath, version);
|
= installationFromPathAndVersion(installationPath, version);
|
||||||
|
|
||||||
if (installation)
|
if (installation) {
|
||||||
|
QJsonValue displayName = vsVersionObj.value("displayName");
|
||||||
|
if (!displayName.isUndefined())
|
||||||
|
installation->displayName = displayName.toString();
|
||||||
installations.append(*installation);
|
installations.append(*installation);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return installations;
|
return installations;
|
||||||
}
|
}
|
||||||
@@ -449,7 +454,8 @@ static Abi findAbiOfMsvc(MsvcToolchain::Type type,
|
|||||||
|
|
||||||
static QString generateDisplayName(const QString &name,
|
static QString generateDisplayName(const QString &name,
|
||||||
MsvcToolchain::Type t,
|
MsvcToolchain::Type t,
|
||||||
MsvcToolchain::Platform p)
|
MsvcToolchain::Platform p,
|
||||||
|
const QString &displayName = {})
|
||||||
{
|
{
|
||||||
if (t == MsvcToolchain::WindowsSDK) {
|
if (t == MsvcToolchain::WindowsSDK) {
|
||||||
QString sdkName = name;
|
QString sdkName = name;
|
||||||
@@ -458,6 +464,8 @@ static QString generateDisplayName(const QString &name,
|
|||||||
}
|
}
|
||||||
// Comes as "9.0" from the registry
|
// Comes as "9.0" from the registry
|
||||||
QString vcName = QLatin1String("Microsoft Visual C++ Compiler ");
|
QString vcName = QLatin1String("Microsoft Visual C++ Compiler ");
|
||||||
|
if (!displayName.isEmpty())
|
||||||
|
vcName = QString::fromLatin1("%1 ").arg(displayName);
|
||||||
vcName += name;
|
vcName += name;
|
||||||
vcName += QString::fromLatin1(" (%1)").arg(platformName(p));
|
vcName += QString::fromLatin1(" (%1)").arg(platformName(p));
|
||||||
return vcName;
|
return vcName;
|
||||||
@@ -2019,7 +2027,7 @@ Toolchains MsvcToolchainFactory::autoDetect(const ToolchainDetector &detector) c
|
|||||||
if (hostSupportsPlatform(platform) && toolchainInstalled) {
|
if (hostSupportsPlatform(platform) && toolchainInstalled) {
|
||||||
results.append(
|
results.append(
|
||||||
findOrCreateToolchains(detector,
|
findOrCreateToolchains(detector,
|
||||||
generateDisplayName(i.vsName, MsvcToolchain::VS, platform),
|
generateDisplayName(i.vsName, MsvcToolchain::VS, platform, i.displayName),
|
||||||
findAbiOfMsvc(MsvcToolchain::VS, platform, i.vsName),
|
findAbiOfMsvc(MsvcToolchain::VS, platform, i.vsName),
|
||||||
i.vcVarsAll,
|
i.vcVarsAll,
|
||||||
platformName(platform)));
|
platformName(platform)));
|
||||||
|
Reference in New Issue
Block a user