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::WindowsMsvc2015Flavor, "msvc2015", {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::WindowsCEFlavor, "ce", {Abi::OS::WindowsOS});
|
||||
registerOsFlavor(Abi::VxWorksFlavor, "vxworks", {Abi::OS::VxWorks});
|
||||
@@ -279,12 +280,15 @@ static QList<Abi> parseCoffHeader(const QByteArray &data)
|
||||
flavor = Abi::WindowsMsvc2013Flavor;
|
||||
break;
|
||||
case 14:
|
||||
flavor = minorLinker >= quint8(10)
|
||||
? Abi::WindowsMsvc2017Flavor // MSVC2017 RC
|
||||
: Abi::WindowsMsvc2015Flavor;
|
||||
if (minorLinker >= quint8(20))
|
||||
flavor = Abi::WindowsMsvc2019Flavor;
|
||||
else if (minorLinker >= quint8(10))
|
||||
flavor = Abi::WindowsMsvc2017Flavor;
|
||||
else
|
||||
flavor = Abi::WindowsMsvc2015Flavor;
|
||||
break;
|
||||
case 15:
|
||||
flavor = Abi::WindowsMsvc2017Flavor;
|
||||
flavor = Abi::WindowsMsvc2019Flavor;
|
||||
break;
|
||||
default: // Keep unknown flavor
|
||||
if (minorLinker != 0)
|
||||
@@ -589,6 +593,13 @@ bool Abi::operator == (const Abi &other) const
|
||||
&& 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
|
||||
{
|
||||
// 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))
|
||||
isCompat = (architecture() == other.architecture()) && (osFlavor() == other.osFlavor());
|
||||
|
||||
// MSVC2017 is compatible with MSVC2015
|
||||
if (!isCompat
|
||||
&& ((osFlavor() == WindowsMsvc2015Flavor && other.osFlavor() == WindowsMsvc2017Flavor)
|
||||
|| (osFlavor() == WindowsMsvc2017Flavor && other.osFlavor() == WindowsMsvc2015Flavor))) {
|
||||
if (!isCompat && compatibleMSVCFlavors(osFlavor(), other.osFlavor()))
|
||||
isCompat = true;
|
||||
}
|
||||
|
||||
return isCompat;
|
||||
}
|
||||
|
||||
@@ -896,6 +904,8 @@ bool Abi::osSupportsFlavor(const Abi::OS &os, const Abi::OSFlavor &flavor)
|
||||
|
||||
Abi::OSFlavor Abi::flavorForMsvcVersion(int version)
|
||||
{
|
||||
if (version >= 1920)
|
||||
return WindowsMsvc2019Flavor;
|
||||
if (version >= 1910)
|
||||
return WindowsMsvc2017Flavor;
|
||||
switch (version) {
|
||||
|
||||
Reference in New Issue
Block a user