diff options
author | Jake Petroules <jake.petroules@petroules.com> | 2015-07-28 12:31:17 -0700 |
---|---|---|
committer | Jake Petroules <jake.petroules@petroules.com> | 2015-07-29 19:15:05 +0000 |
commit | 9373881c3883642e219568c9b3f270085f857407 (patch) | |
tree | 33bc783770e91b6a3392f790d43b0837eb67b608 | |
parent | 303880635145dbbdd4fe0bda89d709b70ecd95cb (diff) |
MSVC probe: support all architectures.
Change-Id: I2331492e2fdb19560e5bef7b23d479a636b2be0c
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
-rw-r--r-- | src/app/qbs-setup-toolchains/msvcinfo.h | 15 | ||||
-rw-r--r-- | src/app/qbs-setup-toolchains/msvcprobe.cpp | 16 | ||||
-rw-r--r-- | src/app/qbs-setup-toolchains/vsenvironmentdetector.cpp | 2 |
3 files changed, 29 insertions, 4 deletions
diff --git a/src/app/qbs-setup-toolchains/msvcinfo.h b/src/app/qbs-setup-toolchains/msvcinfo.h index 0344c72f9..dbd8d2bcb 100644 --- a/src/app/qbs-setup-toolchains/msvcinfo.h +++ b/src/app/qbs-setup-toolchains/msvcinfo.h @@ -31,6 +31,7 @@ #ifndef QBS_MSVCINFO_H #define QBS_MSVCINFO_H +#include <QDir> #include <QHash> #include <QProcessEnvironment> #include <QStringList> @@ -40,16 +41,30 @@ class MSVC public: QString version; QString installPath; + QString pathPrefix; QStringList architectures; typedef QHash<QString, QProcessEnvironment> EnvironmentPerArch; EnvironmentPerArch environments; + + QString clPath(const QString &arch = QString()) { + return QDir::cleanPath( + installPath + QLatin1Char('/') + + pathPrefix + QLatin1Char('/') + + arch + QLatin1Char('/') + + QLatin1String("cl.exe")); + } }; class WinSDK : public MSVC { public: bool isDefault; + + WinSDK() + { + pathPrefix = QLatin1String("bin"); + } }; #endif // QBS_MSVCINFO_H diff --git a/src/app/qbs-setup-toolchains/msvcprobe.cpp b/src/app/qbs-setup-toolchains/msvcprobe.cpp index a224329c8..3e2a7f216 100644 --- a/src/app/qbs-setup-toolchains/msvcprobe.cpp +++ b/src/app/qbs-setup-toolchains/msvcprobe.cpp @@ -79,12 +79,20 @@ static void addMSVCPlatform(const MSVC &msvc, Settings *settings, QList<Profile> profiles << p; } -static void findSupportedArchitectures(MSVC *msvc, const QString &pathPrefix = QString()) +static void findSupportedArchitectures(MSVC *msvc) { - if (QFile::exists(msvc->installPath + pathPrefix + QLatin1String("/cl.exe"))) + if (QFile::exists(msvc->clPath()) + || QFile::exists(msvc->clPath(QLatin1String("amd64_x86")))) msvc->architectures += QLatin1String("x86"); - if (QFile::exists(msvc->installPath + pathPrefix + QLatin1String("/amd64/cl.exe"))) + if (QFile::exists(msvc->clPath(QLatin1String("amd64"))) + || QFile::exists(msvc->clPath(QLatin1String("x86_amd64")))) msvc->architectures += QLatin1String("x86_64"); + if (QFile::exists(msvc->clPath(QLatin1String("ia64"))) + || QFile::exists(msvc->clPath(QLatin1String("x86_ia64")))) + msvc->architectures += QLatin1String("ia64"); + if (QFile::exists(msvc->clPath(QLatin1String("x86_arm"))) + || QFile::exists(msvc->clPath(QLatin1String("amd64_arm")))) + msvc->architectures += QLatin1String("armv7"); } static QString wow6432Key() @@ -118,7 +126,7 @@ void msvcProbe(Settings *settings, QList<Profile> &profiles) continue; if (sdk.installPath.endsWith(QLatin1Char('\\'))) sdk.installPath.chop(1); - findSupportedArchitectures(&sdk, QLatin1String("/bin")); + findSupportedArchitectures(&sdk); if (sdk.isDefault) defaultWinSDK = sdk; winSDKs += sdk; diff --git a/src/app/qbs-setup-toolchains/vsenvironmentdetector.cpp b/src/app/qbs-setup-toolchains/vsenvironmentdetector.cpp index 7fa6dfef5..bbd76c35c 100644 --- a/src/app/qbs-setup-toolchains/vsenvironmentdetector.cpp +++ b/src/app/qbs-setup-toolchains/vsenvironmentdetector.cpp @@ -118,6 +118,8 @@ static void batPrintVars(QTextStream &s, const QStringList &varnames) static QString vcArchitecture(const QString &arch) { + if (arch == QLatin1String("armv7")) + return QLatin1String("arm"); if (arch == QLatin1String("x86_64")) return QLatin1String("amd64"); return arch; |