From a29ee883aef1d0b48996195c77bae26a5584c109 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 30 Aug 2022 15:25:52 +0200 Subject: [PATCH] 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 Reviewed-by: --- src/plugins/projectexplorer/gcctoolchain.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 074bc7ad179..9275072256c 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -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())