forked from qt-creator/qt-creator
ProjectExplorer: Add MSVC2019 flavor support
It is promised to be compatible with prior versions. Change-Id: I85e433382a66c82e9880401c3a983fef06c03606 Reviewed-by: Marco Bubke <marco.bubke@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -112,6 +112,7 @@ static void setupPreregisteredOsFlavors() {
|
|||||||
registerOsFlavor(Abi::WindowsMsvc2013Flavor, "msvc2013", {Abi::OS::WindowsOS});
|
registerOsFlavor(Abi::WindowsMsvc2013Flavor, "msvc2013", {Abi::OS::WindowsOS});
|
||||||
registerOsFlavor(Abi::WindowsMsvc2015Flavor, "msvc2015", {Abi::OS::WindowsOS});
|
registerOsFlavor(Abi::WindowsMsvc2015Flavor, "msvc2015", {Abi::OS::WindowsOS});
|
||||||
registerOsFlavor(Abi::WindowsMsvc2017Flavor, "msvc2017", {Abi::OS::WindowsOS});
|
registerOsFlavor(Abi::WindowsMsvc2017Flavor, "msvc2017", {Abi::OS::WindowsOS});
|
||||||
|
registerOsFlavor(Abi::WindowsMsvc2019Flavor, "msvc2019", {Abi::OS::WindowsOS});
|
||||||
registerOsFlavor(Abi::WindowsMSysFlavor, "msys", {Abi::OS::WindowsOS});
|
registerOsFlavor(Abi::WindowsMSysFlavor, "msys", {Abi::OS::WindowsOS});
|
||||||
registerOsFlavor(Abi::WindowsCEFlavor, "ce", {Abi::OS::WindowsOS});
|
registerOsFlavor(Abi::WindowsCEFlavor, "ce", {Abi::OS::WindowsOS});
|
||||||
registerOsFlavor(Abi::VxWorksFlavor, "vxworks", {Abi::OS::VxWorks});
|
registerOsFlavor(Abi::VxWorksFlavor, "vxworks", {Abi::OS::VxWorks});
|
||||||
@@ -279,12 +280,15 @@ static QList<Abi> parseCoffHeader(const QByteArray &data)
|
|||||||
flavor = Abi::WindowsMsvc2013Flavor;
|
flavor = Abi::WindowsMsvc2013Flavor;
|
||||||
break;
|
break;
|
||||||
case 14:
|
case 14:
|
||||||
flavor = minorLinker >= quint8(10)
|
if (minorLinker >= quint8(20))
|
||||||
? Abi::WindowsMsvc2017Flavor // MSVC2017 RC
|
flavor = Abi::WindowsMsvc2019Flavor;
|
||||||
: Abi::WindowsMsvc2015Flavor;
|
else if (minorLinker >= quint8(10))
|
||||||
|
flavor = Abi::WindowsMsvc2017Flavor;
|
||||||
|
else
|
||||||
|
flavor = Abi::WindowsMsvc2015Flavor;
|
||||||
break;
|
break;
|
||||||
case 15:
|
case 15:
|
||||||
flavor = Abi::WindowsMsvc2017Flavor;
|
flavor = Abi::WindowsMsvc2019Flavor;
|
||||||
break;
|
break;
|
||||||
default: // Keep unknown flavor
|
default: // Keep unknown flavor
|
||||||
if (minorLinker != 0)
|
if (minorLinker != 0)
|
||||||
@@ -589,6 +593,13 @@ bool Abi::operator == (const Abi &other) const
|
|||||||
&& m_wordWidth == other.m_wordWidth;
|
&& m_wordWidth == other.m_wordWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool compatibleMSVCFlavors(const Abi::OSFlavor &left, const Abi ::OSFlavor &right)
|
||||||
|
{
|
||||||
|
// MSVC 2019, 2017 and 2015 are compatible
|
||||||
|
return left >= Abi::WindowsMsvc2015Flavor && left <= Abi::WindowsMsvc2019Flavor
|
||||||
|
&& right >= Abi::WindowsMsvc2015Flavor && right <= Abi::WindowsMsvc2019Flavor;
|
||||||
|
}
|
||||||
|
|
||||||
bool Abi::isCompatibleWith(const Abi &other) const
|
bool Abi::isCompatibleWith(const Abi &other) const
|
||||||
{
|
{
|
||||||
// Generic match: If stuff is identical or the other side is unknown, then this is a match.
|
// Generic match: If stuff is identical or the other side is unknown, then this is a match.
|
||||||
@@ -615,12 +626,9 @@ bool Abi::isCompatibleWith(const Abi &other) const
|
|||||||
if (isCompat && (osFlavor() == AndroidLinuxFlavor || other.osFlavor() == AndroidLinuxFlavor))
|
if (isCompat && (osFlavor() == AndroidLinuxFlavor || other.osFlavor() == AndroidLinuxFlavor))
|
||||||
isCompat = (architecture() == other.architecture()) && (osFlavor() == other.osFlavor());
|
isCompat = (architecture() == other.architecture()) && (osFlavor() == other.osFlavor());
|
||||||
|
|
||||||
// MSVC2017 is compatible with MSVC2015
|
if (!isCompat && compatibleMSVCFlavors(osFlavor(), other.osFlavor()))
|
||||||
if (!isCompat
|
|
||||||
&& ((osFlavor() == WindowsMsvc2015Flavor && other.osFlavor() == WindowsMsvc2017Flavor)
|
|
||||||
|| (osFlavor() == WindowsMsvc2017Flavor && other.osFlavor() == WindowsMsvc2015Flavor))) {
|
|
||||||
isCompat = true;
|
isCompat = true;
|
||||||
}
|
|
||||||
return isCompat;
|
return isCompat;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -896,6 +904,8 @@ bool Abi::osSupportsFlavor(const Abi::OS &os, const Abi::OSFlavor &flavor)
|
|||||||
|
|
||||||
Abi::OSFlavor Abi::flavorForMsvcVersion(int version)
|
Abi::OSFlavor Abi::flavorForMsvcVersion(int version)
|
||||||
{
|
{
|
||||||
|
if (version >= 1920)
|
||||||
|
return WindowsMsvc2019Flavor;
|
||||||
if (version >= 1910)
|
if (version >= 1910)
|
||||||
return WindowsMsvc2017Flavor;
|
return WindowsMsvc2017Flavor;
|
||||||
switch (version) {
|
switch (version) {
|
||||||
|
@@ -89,6 +89,7 @@ public:
|
|||||||
WindowsMsvc2013Flavor,
|
WindowsMsvc2013Flavor,
|
||||||
WindowsMsvc2015Flavor,
|
WindowsMsvc2015Flavor,
|
||||||
WindowsMsvc2017Flavor,
|
WindowsMsvc2017Flavor,
|
||||||
|
WindowsMsvc2019Flavor,
|
||||||
WindowsMSysFlavor,
|
WindowsMSysFlavor,
|
||||||
WindowsCEFlavor,
|
WindowsCEFlavor,
|
||||||
|
|
||||||
|
@@ -384,7 +384,9 @@ static Abi findAbiOfMsvc(MsvcToolChain::Type type,
|
|||||||
else if (version == QLatin1String("v7.0A") || version == QLatin1String("v7.1"))
|
else if (version == QLatin1String("v7.0A") || version == QLatin1String("v7.1"))
|
||||||
msvcVersionString = QLatin1String("10.0");
|
msvcVersionString = QLatin1String("10.0");
|
||||||
}
|
}
|
||||||
if (msvcVersionString.startsWith(QLatin1String("15.")))
|
if (msvcVersionString.startsWith(QLatin1String("16.")))
|
||||||
|
flavor = Abi::WindowsMsvc2019Flavor;
|
||||||
|
else if (msvcVersionString.startsWith(QLatin1String("15.")))
|
||||||
flavor = Abi::WindowsMsvc2017Flavor;
|
flavor = Abi::WindowsMsvc2017Flavor;
|
||||||
else if (msvcVersionString.startsWith(QLatin1String("14.")))
|
else if (msvcVersionString.startsWith(QLatin1String("14.")))
|
||||||
flavor = Abi::WindowsMsvc2015Flavor;
|
flavor = Abi::WindowsMsvc2015Flavor;
|
||||||
@@ -955,6 +957,12 @@ Utils::FileNameList MsvcToolChain::suggestedMkspecList() const
|
|||||||
<< Utils::FileName::fromLatin1("winrt-x86-msvc2017")
|
<< Utils::FileName::fromLatin1("winrt-x86-msvc2017")
|
||||||
<< Utils::FileName::fromLatin1("winrt-x64-msvc2017");
|
<< Utils::FileName::fromLatin1("winrt-x64-msvc2017");
|
||||||
break;
|
break;
|
||||||
|
case Abi::WindowsMsvc2019Flavor:
|
||||||
|
result << Utils::FileName::fromLatin1("win32-msvc2019")
|
||||||
|
<< Utils::FileName::fromLatin1("winrt-arm-msvc2019")
|
||||||
|
<< Utils::FileName::fromLatin1("winrt-x86-msvc2019")
|
||||||
|
<< Utils::FileName::fromLatin1("winrt-x64-msvc2019");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
result.clear();
|
result.clear();
|
||||||
break;
|
break;
|
||||||
|
@@ -1963,6 +1963,8 @@ static Abi refineAbiFromBuildString(const QByteArray &buildString, const Abi &pr
|
|||||||
flavor = Abi::WindowsMsvc2015Flavor;
|
flavor = Abi::WindowsMsvc2015Flavor;
|
||||||
} else if (compiler.startsWith("MSVC 2017") && os == Abi::WindowsOS) {
|
} else if (compiler.startsWith("MSVC 2017") && os == Abi::WindowsOS) {
|
||||||
flavor = Abi::WindowsMsvc2017Flavor;
|
flavor = Abi::WindowsMsvc2017Flavor;
|
||||||
|
} else if (compiler.startsWith("MSVC 2019") && os == Abi::WindowsOS) {
|
||||||
|
flavor = Abi::WindowsMsvc2019Flavor;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Abi(arch, os, flavor, format, wordWidth);
|
return Abi(arch, os, flavor, format, wordWidth);
|
||||||
|
@@ -49,6 +49,7 @@ public:
|
|||||||
WindowsMsvc2013Flavor,
|
WindowsMsvc2013Flavor,
|
||||||
WindowsMsvc2015Flavor,
|
WindowsMsvc2015Flavor,
|
||||||
WindowsMsvc2017Flavor,
|
WindowsMsvc2017Flavor,
|
||||||
|
WindowsMsvc2019Flavor,
|
||||||
WindowsMSysFlavor,
|
WindowsMSysFlavor,
|
||||||
WindowsCEFlavor,
|
WindowsCEFlavor,
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user