aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/qbs-setup-toolchains/probe.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@theqtcompany.com>2016-02-24 15:27:16 +0100
committerChristian Kandeler <christian.kandeler@theqtcompany.com>2016-02-29 12:31:32 +0000
commita0b15306ea358c9e810bdaa29905c551cd570ac1 (patch)
tree91da5ef84efa8dc43c832917fc9e13b700e42244 /src/app/qbs-setup-toolchains/probe.cpp
parentb2cafd6cc4ac8e61b503aed54b0bc3743a0c5a0b (diff)
setup-toolchains: Allow to set up a single, named MSVC profile.
Change-Id: I42ba3fd646ef488435be90f7e4daa6fb7e83f05f Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/app/qbs-setup-toolchains/probe.cpp')
-rw-r--r--src/app/qbs-setup-toolchains/probe.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/app/qbs-setup-toolchains/probe.cpp b/src/app/qbs-setup-toolchains/probe.cpp
index d6aa2ff89..aa3a2f3ef 100644
--- a/src/app/qbs-setup-toolchains/probe.cpp
+++ b/src/app/qbs-setup-toolchains/probe.cpp
@@ -58,9 +58,14 @@ static QTextStream qStderr(stderr);
static QString findExecutable(const QString &fileName)
{
+ QString fullFileName = fileName;
+ if (HostOsInfo::isWindowsHost()
+ && !fileName.endsWith(QLatin1String(".exe"), Qt::CaseInsensitive)) {
+ fullFileName += QLatin1String(".exe");
+ }
const QString path = QString::fromLocal8Bit(qgetenv("PATH"));
foreach (const QString &ppath, path.split(HostOsInfo::pathListSeparator())) {
- const QString fullPath = ppath + QLatin1Char('/') + fileName;
+ const QString fullPath = ppath + QLatin1Char('/') + fullFileName;
if (QFileInfo(fullPath).exists())
return QDir::cleanPath(fullPath);
}
@@ -305,12 +310,9 @@ void createProfile(const QString &profileName, const QString &toolchainType,
else
toolchainTypes = completeToolchainList(toolchainType);
- if (toolchainTypes.contains(QLatin1String("msvc"))) {
- throw qbs::ErrorInfo(Tr::tr("Cannot create profile: MSVC toolchains can only be created "
- "via the auto-detection mechanism."));
- }
-
- if (toolchainTypes.contains(QLatin1String("gcc")))
+ if (toolchainTypes.contains(QLatin1String("msvc")))
+ createMsvcProfile(profileName, compiler.absoluteFilePath(), settings);
+ else if (toolchainTypes.contains(QLatin1String("gcc")))
createGccProfile(compiler.absoluteFilePath(), settings, toolchainTypes, profileName);
else
throw qbs::ErrorInfo(Tr::tr("Cannot create profile: Unknown toolchain type."));