QbsProjectManager: Fix handling of cross-compilers on Windows.

Task-number: QTCREATORBUG-15011
Change-Id: Iea84e1a545bc6f414a35602e1d0c8c903901e813
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Christian Kandeler
2015-09-03 12:36:13 +02:00
parent 396c033707
commit d58002dd46

View File

@@ -62,14 +62,17 @@ using namespace WinRt::Internal::Constants;
static QString extractToolchainPrefix(QString *compilerName)
{
QString prefix;
if (compilerName->endsWith(QLatin1String("-g++"))
|| compilerName->endsWith(QLatin1String("-clang++"))
|| compilerName->endsWith(QLatin1String("-gcc"))
|| compilerName->endsWith(QLatin1String("-clang"))) {
const QStringList candidates = { QLatin1String("g++"), QLatin1String("clang++"),
QLatin1String("gcc"), QLatin1String("clang") };
foreach (const QString &candidate, candidates) {
const QString suffix = Utils::HostOsInfo::withExecutableSuffix(QLatin1Char('-')
+ candidate);
if (compilerName->endsWith(suffix)) {
const int idx = compilerName->lastIndexOf(QLatin1Char('-')) + 1;
prefix = compilerName->left(idx);
compilerName->remove(0, idx);
}
}
return prefix;
}