From 5a2a70adda7d23160195dfebaf85eaab4774a4e4 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 29 Jan 2020 13:33:28 +0100 Subject: [PATCH] GCC: Detect ccache executables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: hjk --- src/plugins/projectexplorer/gcctoolchain.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 1dc211c7c55..ff0e0601662 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1093,6 +1093,13 @@ QList 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());