GCC: Detect ccache executables

These are not in the system PATH as to not make them the default, but it
still makes sense to auto-detect them.

Fixes: QTCREATORBUG-23473
Change-Id: Ia044bd948a7a338f34f729e77e1365d048e87172
Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2020-01-29 13:33:28 +01:00
parent 3890bf4efb
commit 5a2a70adda

View File

@@ -1093,6 +1093,13 @@ QList<ToolChain *> GccToolChainFactory::autoDetectToolchains(
searchPaths << gnuSearchPathsFromRegistry();
searchPaths << atmelSearchPathsFromRegistry();
searchPaths << renesasRl78SearchPathsFromRegistry();
if (HostOsInfo::isAnyUnixHost()) {
FilePath ccachePath = FilePath::fromString("/usr/lib/ccache/bin");
if (!ccachePath.exists())
ccachePath = FilePath::fromString("/usr/lib/ccache");
if (ccachePath.exists() && !searchPaths.contains(ccachePath))
searchPaths << ccachePath;
}
for (const FilePath &dir : searchPaths) {
static const QRegularExpression regexp(binaryRegexp);
QDir binDir(dir.toString());