-
Notifications
You must be signed in to change notification settings - Fork 294
Closed
Description
The option DBUILD_WITH_CCACHE
has no influence on whether ccache is used or not on Fedora (and I believe on Debian too) when ccache is installed:
cmake -DBUILD_WITH_CCACHE=OFF ..
-- The C compiler identification is GNU 8.1.1
-- The CXX compiler identification is GNU 8.1.1
-- Check for working C compiler: /usr/lib64/ccache/gcc
-- Check for working C compiler: /usr/lib64/ccache/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/lib64/ccache/g++
-- Check for working CXX compiler: /usr/lib64/ccache/g++ -- works
The problem is quite simple: once ccache
is installed, it's put into $PATH
before /usr/bin/
(where ordinary gcc
& clang
binaries sit), thus gcc resolves to ccache/gcc
before our switch can do anything.
A viable alternative is to set the CCACHE_DISABLE
environment variable for ccache to true. Then ccache itself will directly call the compiler if it is installed.