Commit d58002dd authored by Christian Kandeler's avatar Christian Kandeler

QbsProjectManager: Fix handling of cross-compilers on Windows.

Task-number: QTCREATORBUG-15011
Change-Id: Iea84e1a545bc6f414a35602e1d0c8c903901e813
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@theqtcompany.com>
parent 396c0337
......@@ -62,13 +62,16 @@ 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 int idx = compilerName->lastIndexOf(QLatin1Char('-')) + 1;
prefix = compilerName->left(idx);
compilerName->remove(0, idx);
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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment