Skip to content

DBUILD_WITH_CCACHE option does not work on Fedora #361

@D4N

Description

@D4N

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions