forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user