diff options
author | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2015-09-03 12:36:13 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2015-09-03 14:13:46 +0000 |
commit | d58002dd4674ed5632714482c9639a2d259007db (patch) | |
tree | 029654198d8a3d3300237a78a1b85cc76a157553 | |
parent | 396c0337074e2442dd467bd02a772b3b7689e079 (diff) | |
download | qt-creator-d58002dd4674ed5632714482c9639a2d259007db.tar.gz |
QbsProjectManager: Fix handling of cross-compilers on Windows.
Task-number: QTCREATORBUG-15011
Change-Id: Iea84e1a545bc6f414a35602e1d0c8c903901e813
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
-rw-r--r-- | src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp index f3e6badb4d..6c04eb8dd9 100644 --- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp +++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp @@ -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; } |