diff options
author | Jake Petroules <jake.petroules@petroules.com> | 2014-03-02 03:08:15 -0500 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@digia.com> | 2014-03-04 14:56:34 +0100 |
commit | db5754e19eefbed2c994e39c4db828d5685ba0b2 (patch) | |
tree | cf0011e22fd790ed6af215f67962f91849d771cc /src/app | |
parent | b13126f71d0b70dab117821903d9dc632b2c7ca6 (diff) |
Detect MinGW on all platforms.
Change-Id: I4e93aadf5b196087942af1b427cfef8d6b7dc72b
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/qbs-setup-toolchains/probe.cpp | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/src/app/qbs-setup-toolchains/probe.cpp b/src/app/qbs-setup-toolchains/probe.cpp index b1beeeba1..b21b32c53 100644 --- a/src/app/qbs-setup-toolchains/probe.cpp +++ b/src/app/qbs-setup-toolchains/probe.cpp @@ -200,10 +200,22 @@ static void gccProbe(Settings *settings, QList<Profile> &profiles, const QString static void mingwProbe(Settings *settings, QList<Profile> &profiles) { - const QString gccPath - = findExecutable(HostOsInfo::appendExecutableSuffix(QLatin1String("gcc"))); - if (!gccPath.isEmpty()) - profiles << createMingwProfile(gccPath, settings); + // List of possible compiler binary names for this platform + QStringList compilerNames; + if (HostOsInfo::isWindowsHost()) { + compilerNames << QLatin1String("gcc"); + } else { + foreach (const QString &machineName, validMinGWMachines()) { + compilerNames << machineName + QLatin1String("-gcc"); + } + } + + foreach (const QString &compilerName, compilerNames) { + const QString gccPath + = findExecutable(HostOsInfo::appendExecutableSuffix(compilerName)); + if (!gccPath.isEmpty()) + profiles << createMingwProfile(gccPath, settings); + } } void probe(Settings *settings) @@ -211,16 +223,17 @@ void probe(Settings *settings) QList<Profile> profiles; if (HostOsInfo::isWindowsHost()) { msvcProbe(settings, profiles); - mingwProbe(settings, profiles); - } else if (HostOsInfo::isOsxHost()) { - xcodeProbe(settings, profiles); - gccProbe(settings, profiles, QLatin1String("gcc")); - gccProbe(settings, profiles, QLatin1String("clang")); } else { gccProbe(settings, profiles, QLatin1String("gcc")); gccProbe(settings, profiles, QLatin1String("clang")); + + if (HostOsInfo::isOsxHost()) { + xcodeProbe(settings, profiles); + } } + mingwProbe(settings, profiles); + if (profiles.isEmpty()) { qStderr << Tr::tr("Could not detect any toolchains. No profile created.") << endl; } else if (profiles.count() == 1 && settings->defaultProfile().isEmpty()) { |