Auto-detect ccache compilers on macOS

From some standard locations. When installing ccache with Homebrew, it
is installed in architecture dependent directory and links are
automatically created. When installing ccache with MacPorts, no links
are created, but the MacPorts wiki at trac.macports.org has a suggestion
for a script that creates them at /opt/local/libexec/ccache in its howto
section.

Fixes: QTCREATORBUG-27792
Change-Id: Ib173f81384a03b867cb54f45dac698ead95ecef6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Eike Ziller
2022-08-30 15:25:52 +02:00
parent c79d4bd606
commit a29ee883ae

View File

@@ -1129,6 +1129,11 @@ static FilePaths findCompilerCandidates(const ToolchainDetector &detector,
searchPaths << gnuSearchPathsFromRegistry();
searchPaths << atmelSearchPathsFromRegistry();
searchPaths << renesasRl78SearchPathsFromRegistry();
if (HostOsInfo::isMacHost()) {
searchPaths << "/opt/homebrew/opt/ccache/libexec" // homebrew arm
<< "/usr/local/opt/ccache/libexec" // homebrew intel
<< "/opt/local/libexec/ccache"; // macports, no links are created automatically though
}
if (HostOsInfo::isAnyUnixHost()) {
FilePath ccachePath = "/usr/lib/ccache/bin";
if (!ccachePath.exists())