diff options
author | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2016-06-29 15:06:11 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2016-06-29 13:22:21 +0000 |
commit | 340ed4b1431184d03b3c90baf5a85dde9f165cdb (patch) | |
tree | 1fb90cd2200f177ed1c493357f0162988642e6ac /src/app | |
parent | 371a81434b06166317663fa4ffe8beee502ad711 (diff) |
Fix regression in setup-toolchains
The tool should not abort just because one profile could not be set up.
Change-Id: I88cf897b3346fb75d12bb32b9f5f634f34f3c1b2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/qbs-setup-toolchains/msvcprobe.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/app/qbs-setup-toolchains/msvcprobe.cpp b/src/app/qbs-setup-toolchains/msvcprobe.cpp index ffaaabc5a..ca6f074cd 100644 --- a/src/app/qbs-setup-toolchains/msvcprobe.cpp +++ b/src/app/qbs-setup-toolchains/msvcprobe.cpp @@ -76,9 +76,14 @@ static void setQtHelperProperties(Profile &p, const QString &architecture, targetArch = QStringLiteral("armv7"); p.setValue(QStringLiteral("qbs.architecture"), canonicalArchitecture(targetArch)); - p.setValue(QStringLiteral("cpp.compilerVersionMajor"), - msvc.compilerDefines(compilerFilePath)[QStringLiteral("_MSC_FULL_VER")] - .toString().mid(0, 2).toInt()); + try { + const QVariantMap defines = msvc.compilerDefines(compilerFilePath); + p.setValue(QStringLiteral("cpp.compilerVersionMajor"), + defines[QStringLiteral("_MSC_FULL_VER")].toString().mid(0, 2).toInt()); + } catch (const ErrorInfo &error) { + p.removeProfile(); + qDebug("Warning: Failed to retrieve compiler defines: %s", qPrintable(error.toString())); + } } static void addMSVCPlatform(Settings *settings, QList<Profile> &profiles, |