-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DBUILD_WITH_CCACHE option does not work on Fedora #361
Comments
Hi @D4N . I think we discussed this some time ago via Slack and we concluded that the problem here is the way in which those distributions alter the symbolic links in the system when ccache is installed. The CMake code taking care of ccache in exiv2 is:
If |
We could add a note into the readme or some other file so that people
don't get confused by it.
But otherwise I fully agree, there is nothing we can do about $PATH, so
the actual issue itself can be closed.
Luis Díaz Más <notifications@github.com> writes:
… Hi @D4N . I think we discussed this some time ago via Slack and we concluded that the problem here is the way in which those distributions alter the symbolic links in the system when **ccache** is installed.
The CMake code taking care of ccache in exiv2 is:
```
if( BUILD_WITH_CCACHE )
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
message(STATUS "Program ccache found")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif()
endif()
```
If `BUILD_WITH_CCACHE` is disabled, CMake will just rely in the default compiler detected in the system. There is not much we can do about it. Should we close this issue?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#361 (comment)
|
I'd like to document and close this issue. However this is very confusing. If I think you're saying that installing ccache modifies the PATH and the correct way to enable/disable is the environment variable CCACHE_DISABLE Of have I misunderstood? |
It works normally, but in Fedora it seems there were some issues (Explained already by Dan). We do not need to do anything about the code, but Dan thought about adding some notes. |
OK. So there's something wrong on Fedora. I'll add a section to README.md concerning ccache tomorrow and I'll mention this. Then we can get this closed. |
|
As far as I know it is common on various Linux distros to put ccache into Is anyone actually using this option (I personally don't)? |
|
I personally use it a lot and on Ubuntu where it works as expected:
I actually think we could use that same CMake option to control whether clcache should be used on Windows (we could rename the variable to something like BUILD_WITH_CACHE). |
Since this is documented in #557 (which will be merged tomorrow), I'll close this issue. |
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:The problem is quite simple: once
ccache
is installed, it's put into$PATH
before/usr/bin/
(where ordinarygcc
&clang
binaries sit), thus gcc resolves toccache/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.The text was updated successfully, but these errors were encountered: